From patchwork Tue Jul 29 03:38:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Lutomirski X-Patchwork-Id: 4638331 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8DA939F503 for ; Tue, 29 Jul 2014 03:42:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B44D82018E for ; Tue, 29 Jul 2014 03:42:18 +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 D874D20158 for ; Tue, 29 Jul 2014 03:42:17 +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 1XByFt-00033c-8Z; Tue, 29 Jul 2014 03:39:13 +0000 Received: from mail-pd0-f169.google.com ([209.85.192.169]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XByFm-0002y3-PZ for linux-arm-kernel@lists.infradead.org; Tue, 29 Jul 2014 03:39:07 +0000 Received: by mail-pd0-f169.google.com with SMTP id y10so11047168pdj.0 for ; Mon, 28 Jul 2014 20:38:45 -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=zStVeuj7o/rf0vJ1C6QRL5Y8ra7ACBFZyMyO3pa8i38=; b=YEy3x0qtTFTv17F/JROUv2JyYm35PGURoABVMxpuCDFYKYvaYyjJdBDQXHu4FyBYBI Iqkyclqpt/8Cmyl3R4CmUth75CFyu85UrueyNaxsYcCrrTKBQ5M3Im3AmmUVm9Mn2XOn 9ezMJLn7Pxc0GzBzYy1sSXdkB63d1zHr/5nf+YOdpGSxq19VUettkFXBG+YYdYT9dlOz YgPivUOLCz83B8EphKc6U1VBrylEJkHyP1Ezb7WCNTww/AroUQrphSkvAj+Alo2mMuPZ MVdOs2420iW1ezDa5zEKfKft/R0VfRviuhT7japDLeTvRB0WqP14hjKR4MbyMaazO9Gi SbQg== X-Gm-Message-State: ALoCoQl/ME8Yh1MaAqPrw4mKjr1Epj9aRQyCCLIoBVEYePBRR00UR23Bj1V3bZuS4BT8vUpxuhzA X-Received: by 10.66.191.9 with SMTP id gu9mr42734294pac.27.1406605124976; Mon, 28 Jul 2014 20:38:44 -0700 (PDT) Received: from localhost ([2001:5a8:4:83c0:fd15:6cb4:fa7d:1e89]) by mx.google.com with ESMTPSA id c17sm26772083pdm.33.2014.07.28.20.38.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jul 2014 20:38:43 -0700 (PDT) From: Andy Lutomirski To: linux-kernel@vger.kernel.org, Kees Cook , Will Drewry Subject: [PATCH v4 1/5] x86,x32,audit: Fix x32's AUDIT_ARCH wrt audit Date: Mon, 28 Jul 2014 20:38:28 -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-20140728_203906_856570_94038F3B X-CRM114-Status: UNSURE ( 9.78 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.4 (-) Cc: linux-arch@vger.kernel.org, linux-mips@linux-mips.org, Frederic Weisbecker , x86@kernel.org, Oleg Nesterov , 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=-2.6 required=5.0 tests=BAYES_00,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 93c182a..39296d2 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,