From patchwork Fri Sep 5 22:13:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Lutomirski X-Patchwork-Id: 4855121 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BA94BC0338 for ; Fri, 5 Sep 2014 22:17:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DEEE120211 for ; Fri, 5 Sep 2014 22:17:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2190E201F7 for ; Fri, 5 Sep 2014 22:17:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XQ1mJ-0000gy-MM; Fri, 05 Sep 2014 22:14:47 +0000 Received: from mail-yk0-f181.google.com ([209.85.160.181]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XQ1m3-0000Ns-3n for linux-arm-kernel@lists.infradead.org; Fri, 05 Sep 2014 22:14:31 +0000 Received: by mail-yk0-f181.google.com with SMTP id 131so7358546ykp.40 for ; Fri, 05 Sep 2014 15:14:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=WMKjs3o0VvrVtW0lSKNsSqgvIyWM27Uam0khU+M4Ds0=; b=OgNOq6VUb8Sg+SSxSK/iyy5+0ts0coIZ/bGPNtSE32y9mwr1Rq+eEO4uwuQGB1dd0e oWXZvWhhKFsEbiPGIPZG1yDYQPMVQazurA/NU4G5iv3AKHSKxHLv0YhICQ9eiI5Z2r/3 56VxKo7zy30eToNyjptYuMl6i1jhzUUGu1Rr5+D7q47FReyckB/tliZAWCQR56BnBJmZ TtR63tqvf+hZtpvtGiH982kYeZoNcvQVcyaQNHF3qpU2zScQxrjPS+RYtp5sUw7AeYQG VBI/x5bdbc/JGCmnd430zdpLXHPBzEoPoCadMWZXEmfAh/ohA/FVg5vfC8RUTIiZTLq5 hUcw== X-Gm-Message-State: ALoCoQnYSxmTXrlsa3nYWSzVmt+gG3i4fz8Kg3DkbaSp6jcGvxMawlixjAV3IU9tCaiHTn8Odjrv X-Received: by 10.236.157.134 with SMTP id o6mr18750173yhk.92.1409955249612; Fri, 05 Sep 2014 15:14:09 -0700 (PDT) Received: from localhost ([2602:301:77d8:1800:bd9e:fe09:e642:968]) by mx.google.com with ESMTPSA id k67sm1295128yhq.17.2014.09.05.15.14.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Sep 2014 15:14:08 -0700 (PDT) From: Andy Lutomirski To: linux-kernel@vger.kernel.org, Kees Cook , Will Drewry , Oleg Nesterov Subject: [PATCH v5 1/5] x86,x32,audit: Fix x32's AUDIT_ARCH wrt audit Date: Fri, 5 Sep 2014 15:13:52 -0700 Message-Id: X-Mailer: git-send-email 1.9.3 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140905_151431_237730_84B6D614 X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: linux-arch@vger.kernel.org, linux-mips@linux-mips.org, Frederic Weisbecker , x86@kernel.org, Andy Lutomirski , linux-security-module@vger.kernel.org, hpa@zytor.com, linux-arm-kernel@lists.infradead.org, Alexei Starovoitov X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP is_compat_task() is the wrong check for audit arch; the check should be is_ia32_task(): x32 syscalls should be AUDIT_ARCH_X86_64, not AUDIT_ARCH_I386. CONFIG_AUDITSYSCALL is currently incompatible with x32, so this has no visible effect. Signed-off-by: Andy Lutomirski --- arch/x86/kernel/ptrace.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 93c182a00506..39296d25708c 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c @@ -1441,15 +1441,6 @@ void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, force_sig_info(SIGTRAP, &info, tsk); } - -#ifdef CONFIG_X86_32 -# define IS_IA32 1 -#elif defined CONFIG_IA32_EMULATION -# define IS_IA32 is_compat_task() -#else -# define IS_IA32 0 -#endif - /* * We must return the syscall number to actually look up in the table. * This can be -1L to skip running any syscall at all. @@ -1487,7 +1478,7 @@ long syscall_trace_enter(struct pt_regs *regs) if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) trace_sys_enter(regs, regs->orig_ax); - if (IS_IA32) + if (is_ia32_task()) audit_syscall_entry(AUDIT_ARCH_I386, regs->orig_ax, regs->bx, regs->cx,