From patchwork Fri Jan 17 08:13:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 3502591 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 504DF9F2E9 for ; Fri, 17 Jan 2014 08:17:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7533820103 for ; Fri, 17 Jan 2014 08:17:09 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (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 611CF200DB for ; Fri, 17 Jan 2014 08:17:08 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W44aR-0000Xa-D8; Fri, 17 Jan 2014 08:15:31 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W44Zy-00025r-4u; Fri, 17 Jan 2014 08:15:02 +0000 Received: from mail-pd0-f173.google.com ([209.85.192.173]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W44ZY-0001yi-Ts for linux-arm-kernel@lists.infradead.org; Fri, 17 Jan 2014 08:14:38 +0000 Received: by mail-pd0-f173.google.com with SMTP id y10so156534pdj.18 for ; Fri, 17 Jan 2014 00:14:15 -0800 (PST) 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; bh=hVXRfe4VTtjtVlz2jJ9s7L4zToPnne9r7s6ASlo7Gvs=; b=Wc1QMY1Nh5aH/Vb3uqRwAU9PkA7ws0a7jD6UNf0NP3881C9M0TDKWKrN4E37IdIOPT CtMGEWViIczNB1lFdlcNqjPOvZMminTe1qMRETp1hl6VOwC67KiQq6yMK7tUdXytf5WV hbD7LJzLVQpmIOxFKJVwZF+ZhReGkYV9YIFIKhz9d6cR+Mf+c2Gvf1VVSym5eIAgzFKl 2tHe7bgNVzl81tN2uv8/jN5FJTkVArWaNjaRyuX+oiVoLxLMpaD7CVBHYQQnqc7B4J0n BHKZTXGc9HIKasF1SgzfSDMwhz67IG9OUABT1ZIlAE6IHIZ3JykS20kuqrS4bvITegRi XgwA== X-Gm-Message-State: ALoCoQkIjZZf9EbFX18x7QamS6v9nDxNgmHIr6J3H5V/agYkMX+JMl2lCJsU9IHj4gGX+Dgu4hkm X-Received: by 10.68.143.231 with SMTP id sh7mr628199pbb.7.1389946455213; Fri, 17 Jan 2014 00:14:15 -0800 (PST) Received: from localhost.localdomain (KD182250177246.au-net.ne.jp. [182.250.177.246]) by mx.google.com with ESMTPSA id jn12sm20572056pbd.37.2014.01.17.00.14.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Jan 2014 00:14:13 -0800 (PST) From: AKASHI Takahiro To: viro@zeniv.linux.org.uk, eparis@redhat.com, rgb@redhat.com, catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH v2 4/6] arm64: audit: Add 32-bit (compat) syscall support Date: Fri, 17 Jan 2014 17:13:17 +0900 Message-Id: <1389946399-4525-5-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1389946399-4525-1-git-send-email-takahiro.akashi@linaro.org> References: <1383733546-2846-1-git-send-email-takahiro.akashi@linaro.org> <1389946399-4525-1-git-send-email-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140117_031437_102222_4B9EFFA7 X-CRM114-Status: GOOD ( 14.29 ) X-Spam-Score: -1.9 (-) Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, arndb@arndb.de, linux-kernel@vger.kernel.org, AKASHI Takahiro , linux-audit@redhat.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Generic audit code also support compat system calls now. This patch adds a small piece of architecture dependent code. Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/audit.h | 20 ++++++++++++++++++++ arch/arm64/include/asm/syscall.h | 10 ++++++++++ 2 files changed, 30 insertions(+) create mode 100644 arch/arm64/include/asm/audit.h diff --git a/arch/arm64/include/asm/audit.h b/arch/arm64/include/asm/audit.h new file mode 100644 index 0000000..70eef50 --- /dev/null +++ b/arch/arm64/include/asm/audit.h @@ -0,0 +1,20 @@ +/* + * arch/arm64/include/asm/audit.h + * + * Copyright (C) 2013 Linaro Limited + * Author: AKASHI Takahiro + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __ASM_AUDIT_H +#define __ASM_AUDIT_H + +#include + +#define audit_is_compat(arch) \ + ((arch == AUDIT_ARCH_ARM) || (arch == AUDIT_ARCH_ARMEB)) + +#endif /* __ASM_AUDIT_H */ diff --git a/arch/arm64/include/asm/syscall.h b/arch/arm64/include/asm/syscall.h index 3361fec..d7660e9 100644 --- a/arch/arm64/include/asm/syscall.h +++ b/arch/arm64/include/asm/syscall.h @@ -19,6 +19,7 @@ #include #include #include +#include static inline int syscall_get_nr(struct task_struct *task, @@ -109,6 +110,15 @@ static inline void syscall_set_arguments(struct task_struct *task, static inline int syscall_get_arch(struct task_struct *task, struct pt_regs *regs) { +#ifdef CONFIG_COMPAT + if (is_compat_thread(task_thread_info(task))) +#ifdef __AARCH64EB__ + return AUDIT_ARCH_ARMEB; /* only BE on BE */ +#else + return AUDIT_ARCH_ARM; +#endif +#endif + #ifdef __AARCH64EB__ return AUDIT_ARCH_AARCH64EB; #else