Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2992502Ab2KATrV (ORCPT ); Thu, 1 Nov 2012 15:47:21 -0400 Received: from smtp.outflux.net ([198.145.64.163]:58140 "EHLO smtp.outflux.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964853Ab2KATrR (ORCPT ); Thu, 1 Nov 2012 15:47:17 -0400 From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Russell King , Will Deacon , Will Drewry , Geremy Condra , Al Viro , Catalin Marinas , Kees Cook Subject: [PATCH 3/4] arch/arm: allow a scno of -1 to not cause a SIGILL Date: Thu, 1 Nov 2012 12:46:38 -0700 Message-Id: <1351799199-6853-4-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1351799199-6853-1-git-send-email-keescook@chromium.org> References: <1351799199-6853-1-git-send-email-keescook@chromium.org> X-HELO: www.outflux.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1154 Lines: 37 From: Will Drewry 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 Signed-off-by: Kees Cook --- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/