From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759601AbbBIILB (ORCPT ); Mon, 9 Feb 2015 03:11:01 -0500 Received: from mail-bl2on0107.outbound.protection.outlook.com ([65.55.169.107]:51104 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753229AbbBIILA (ORCPT ); Mon, 9 Feb 2015 03:11:00 -0500 X-Greylist: delayed 923 seconds by postgrey-1.27 at vger.kernel.org; Mon, 09 Feb 2015 03:11:00 EST From: Bogdan Purcareata To: , , CC: , , , Bogdan Purcareata Subject: [PATCH 2/3] powerpc: Relax secure computing on syscall entry trace Date: Mon, 9 Feb 2015 07:55:15 +0000 Message-ID: <1423468516-8688-3-git-send-email-bogdan.purcareata@freescale.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1423468516-8688-1-git-send-email-bogdan.purcareata@freescale.com> References: <1423468516-8688-1-git-send-email-bogdan.purcareata@freescale.com> X-EOPAttributedMessage: 0 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=bogdan.purcareata@freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(339900001)(77096005)(2950100001)(77156002)(62966003)(2201001)(104016003)(33646002)(50986999)(76176999)(87936001)(49486002)(106466001)(105606002)(19580395003)(19580405001)(6806004)(92566002)(48376002)(50466002)(85426001)(229853001)(36756003)(46102003)(50226001)(47776003);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR03MB184;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Antispam: UriScan:;UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB184; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004);SRVR:BLUPR03MB184; X-Forefront-PRVS: 04825EA361 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB184; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2015 07:55:36.7038 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB184 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB453; X-OriginatorOrg: freescale.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The secure_computing_strict will just force the kernel to panic on secure_computing failure. Once SECCOMP_FILTER support is enabled in the kernel, syscalls can be denied without system failure. Signed-off-by: Bogdan Purcareata --- arch/powerpc/kernel/ptrace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index 100e01c..5c654ac 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c @@ -1772,7 +1772,9 @@ long do_syscall_trace_enter(struct pt_regs *regs) user_exit(); - secure_computing_strict(regs->gpr[0]); + /* Do the secure computing check first; failures should be fast. */ + if (secure_computing(regs->gpr[0]) == -1) + return -1L; if (test_thread_flag(TIF_SYSCALL_TRACE) && tracehook_report_syscall_entry(regs)) -- 2.1.4