From patchwork Tue Jul 15 19:32:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Lutomirski X-Patchwork-Id: 4557981 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 C58EBC0514 for ; Tue, 15 Jul 2014 19:35:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0DA8D2018A for ; Tue, 15 Jul 2014 19:35: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 41C8E20123 for ; Tue, 15 Jul 2014 19:35:09 +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 1X78Tg-0006Pv-RS; Tue, 15 Jul 2014 19:33:28 +0000 Received: from mail-pa0-f54.google.com ([209.85.220.54]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X78Tb-0006Ec-HN for linux-arm-kernel@lists.infradead.org; Tue, 15 Jul 2014 19:33:23 +0000 Received: by mail-pa0-f54.google.com with SMTP id fa1so4381824pad.41 for ; Tue, 15 Jul 2014 12:33:02 -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=OmHozuaIcsQgBOTdB/NgRp2+VytHODqrZntsIdGJV6MoeTyxHs37QYlNIlMGdByLdJ McNGiCeiVh9FaMUepR/BuwFL+oyGcshv8gKTMBz961txYRR2cHv4Kwyrlcor4J2LgGyu r2PbTap/n+vUzX4KxjWTsbwsyjaPfwtKmOdaZ76dtVcybOsiPiZxSXOv+AeuyjsUlVWf DgRXV/9wkeEffIvXJ53JKCrJdB7OxRLaSCgdilWYJ0qWWFFZflIxUSNSW/rbDe00InVR iwpyxT0oFLumwu/2QXNqu3ZBIRgtASx3O7vuETP/eNygrGUB2+jAj19ksNe79R+ldIZo jkJg== X-Gm-Message-State: ALoCoQlBo3lsAs/cb0rduC/jFD0MRrrIWOEJToiOut7cNPquKx1UAtwTkAcCnbD9dxPNRufP9jqT X-Received: by 10.68.130.130 with SMTP id oe2mr3866603pbb.154.1405452782464; Tue, 15 Jul 2014 12:33:02 -0700 (PDT) Received: from localhost ([2001:5a8:4:83c0:b456:e6bb:934a:3ab7]) by mx.google.com with ESMTPSA id w7sm18036114pdo.90.2014.07.15.12.32.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jul 2014 12:33:00 -0700 (PDT) From: Andy Lutomirski To: linux-kernel@vger.kernel.org, Kees Cook , Will Drewry , James Morris Subject: [PATCH 4/7] x86,x32,audit: Fix x32's AUDIT_ARCH wrt audit Date: Tue, 15 Jul 2014 12:32:33 -0700 Message-Id: <06044c708e871e3c70e476ccf08befb3910de7d6.1405452484.git.luto@amacapital.net> 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-20140715_123323_604388_74A75290 X-CRM114-Status: UNSURE ( 9.74 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: linux-arch@vger.kernel.org, linux-mips@linux-mips.org, x86@kernel.org, Oleg Nesterov , Andy Lutomirski , linux-security-module@vger.kernel.org, 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=-1.9 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,