Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f275de5 authored by Andy Lutomirski's avatar Andy Lutomirski Committed by Kees Cook
Browse files

seccomp: Add a seccomp_data parameter secure_computing()



Currently, if arch code wants to supply seccomp_data directly to
seccomp (which is generally much faster than having seccomp do it
using the syscall_get_xyz() API), it has to use the two-phase
seccomp hooks. Add it to the easy hooks, too.

Cc: linux-arch@vger.kernel.org
Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent 58d0a862
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -934,7 +934,7 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs, int scno)

	/* Do the secure computing check first; failures should be fast. */
#ifdef CONFIG_HAVE_ARCH_SECCOMP_FILTER
	if (secure_computing() == -1)
	if (secure_computing(NULL) == -1)
		return -1;
#else
	/* XXX: remove this once OABI gets fixed */
+1 −1
Original line number Diff line number Diff line
@@ -1247,7 +1247,7 @@ static void tracehook_report_syscall(struct pt_regs *regs,
asmlinkage int syscall_trace_enter(struct pt_regs *regs)
{
	/* Do the secure computing check first; failures should be fast. */
	if (secure_computing() == -1)
	if (secure_computing(NULL) == -1)
		return -1;

	if (test_thread_flag(TIF_SYSCALL_TRACE))
+1 −1
Original line number Diff line number Diff line
@@ -893,7 +893,7 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)

	current_thread_info()->syscall = syscall;

	if (secure_computing() == -1)
	if (secure_computing(NULL) == -1)
		return -1;

	if (test_thread_flag(TIF_SYSCALL_TRACE) &&
+1 −1
Original line number Diff line number Diff line
@@ -312,7 +312,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
long do_syscall_trace_enter(struct pt_regs *regs)
{
	/* Do the secure computing check first. */
	if (secure_computing() == -1)
	if (secure_computing(NULL) == -1)
		return -1;

	if (test_thread_flag(TIF_SYSCALL_TRACE) &&
+1 −1
Original line number Diff line number Diff line
@@ -1783,7 +1783,7 @@ static int do_seccomp(struct pt_regs *regs)
	 * have already loaded -ENOSYS into r3, or seccomp has put
	 * something else in r3 (via SECCOMP_RET_ERRNO/TRACE).
	 */
	if (__secure_computing())
	if (__secure_computing(NULL))
		return -1;

	/*
Loading