mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 02:01:18 -04:00
seccomp: remove the 'sd' argument from __secure_computing()
After the previous changes 'sd' is always NULL. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Kees Cook <kees@kernel.org> Link: https://lore.kernel.org/r/20250128150313.GA15336@redhat.com Signed-off-by: Kees Cook <kees@kernel.org>
This commit is contained in:
@@ -49,7 +49,7 @@ long syscall_trace_enter(struct pt_regs *regs, long syscall,
|
||||
|
||||
/* Do seccomp after ptrace, to catch any tracer changes. */
|
||||
if (work & SYSCALL_WORK_SECCOMP) {
|
||||
ret = __secure_computing(NULL);
|
||||
ret = __secure_computing();
|
||||
if (ret == -1L)
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1072,10 +1072,9 @@ void secure_computing_strict(int this_syscall)
|
||||
else
|
||||
BUG();
|
||||
}
|
||||
int __secure_computing(const struct seccomp_data *sd)
|
||||
int __secure_computing(void)
|
||||
{
|
||||
int this_syscall = sd ? sd->nr :
|
||||
syscall_get_nr(current, current_pt_regs());
|
||||
int this_syscall = syscall_get_nr(current, current_pt_regs());
|
||||
|
||||
secure_computing_strict(this_syscall);
|
||||
return 0;
|
||||
@@ -1365,7 +1364,7 @@ static int __seccomp_filter(int this_syscall, const struct seccomp_data *sd,
|
||||
}
|
||||
#endif
|
||||
|
||||
int __secure_computing(const struct seccomp_data *sd)
|
||||
int __secure_computing(void)
|
||||
{
|
||||
int mode = current->seccomp.mode;
|
||||
int this_syscall;
|
||||
@@ -1374,15 +1373,14 @@ int __secure_computing(const struct seccomp_data *sd)
|
||||
unlikely(current->ptrace & PT_SUSPEND_SECCOMP))
|
||||
return 0;
|
||||
|
||||
this_syscall = sd ? sd->nr :
|
||||
syscall_get_nr(current, current_pt_regs());
|
||||
this_syscall = syscall_get_nr(current, current_pt_regs());
|
||||
|
||||
switch (mode) {
|
||||
case SECCOMP_MODE_STRICT:
|
||||
__secure_computing_strict(this_syscall); /* may call do_exit */
|
||||
return 0;
|
||||
case SECCOMP_MODE_FILTER:
|
||||
return __seccomp_filter(this_syscall, sd, false);
|
||||
return __seccomp_filter(this_syscall, NULL, false);
|
||||
/* Surviving SECCOMP_RET_KILL_* must be proactively impossible. */
|
||||
case SECCOMP_MODE_DEAD:
|
||||
WARN_ON_ONCE(1);
|
||||
|
||||
Reference in New Issue
Block a user