[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1351799199-6853-4-git-send-email-keescook@chromium.org>
Date: Thu, 1 Nov 2012 12:46:38 -0700
From: Kees Cook <keescook@...omium.org>
To: linux-kernel@...r.kernel.org
Cc: Russell King <linux@....linux.org.uk>,
Will Deacon <will.deacon@....com>,
Will Drewry <wad@...omium.org>,
Geremy Condra <gcondra@...gle.com>,
Al Viro <viro@...iv.linux.org.uk>,
Catalin Marinas <catalin.marinas@....com>,
Kees Cook <keescook@...omium.org>
Subject: [PATCH 3/4] arch/arm: allow a scno of -1 to not cause a SIGILL
From: Will Drewry <wad@...omium.org>
On tracehook-friendly platforms, a system call number of -1 falls
through without running much code or taking much action.
ARM is different. This adds a lightweight check to arm_syscall()
to make sure that ARM behaves the same way.
Signed-off-by: Will Drewry <wad@...omium.org>
Signed-off-by: Kees Cook <keescook@...omium.org>
---
arch/arm/kernel/traps.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index b0179b8..f303ea6 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -540,6 +540,10 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
struct thread_info *thread = current_thread_info();
siginfo_t info;
+ /* Emulate/fallthrough. */
+ if (no == -1)
+ return regs->ARM_r0;
+
if ((no >> 16) != (__ARM_NR_BASE>> 16))
return bad_syscall(no, regs);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists