From patchwork Mon Feb 3 06:56:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 24026 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5BD2C20675 for ; Mon, 3 Feb 2014 06:57:16 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wo20sf26783775obc.11 for ; Sun, 02 Feb 2014 22:57: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:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=hctLbw7P+QojnXJkGxnwxl5syNG6FOg6V2Pd+2r9+Dw=; b=K66A4SLVABC5dVgfa9224RCphBC+gOLf4GYvKMYA563hEv4nlIzCUDBqcbXoJH6neF Ow3U1MgPVdZOIldxLO7b6+FQgtKdwoBQb3/7zTQS15F59dk5nWIM3uXMvKyq93Jm6HRp bECTvnZNy+5EnxeOD5y0X3Po7+7MWfCwgi2SKzPxNQRYYe8AMHgp/8gwKPn+de/9jCHs zURHxw8cLIH0NKINqz5IuE4G44Z/l+u+gZ5w7yuAMCHAZpaCG/OL1Dr4ibEruKf00UMV 1PLRdEZ2+DY0W+gU84sD1y+k8ClNzCKOzIFByw7xOrQSN57gEC6V6/fvaQIdSA9Z/oRw /cEg== X-Gm-Message-State: ALoCoQlOlm5AZq+B+EtSE8Bhdpl7Mr/in9abZ0QiHGarMGmugePGTqOFdk1H3agVsGv/EZfKQfIt X-Received: by 10.182.109.200 with SMTP id hu8mr13667006obb.20.1391410635405; Sun, 02 Feb 2014 22:57:15 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.29.102 with SMTP id a93ls1704466qga.33.gmail; Sun, 02 Feb 2014 22:57:15 -0800 (PST) X-Received: by 10.52.163.65 with SMTP id yg1mr23200394vdb.14.1391410635311; Sun, 02 Feb 2014 22:57:15 -0800 (PST) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id kl10si6570326vdb.25.2014.02.02.22.57.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 02 Feb 2014 22:57:15 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id if11so4374262vcb.8 for ; Sun, 02 Feb 2014 22:57:15 -0800 (PST) X-Received: by 10.220.133.80 with SMTP id e16mr27400097vct.13.1391410635218; Sun, 02 Feb 2014 22:57:15 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp136219vcz; Sun, 2 Feb 2014 22:57:14 -0800 (PST) X-Received: by 10.66.102.4 with SMTP id fk4mr35000526pab.59.1391410634169; Sun, 02 Feb 2014 22:57:14 -0800 (PST) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by mx.google.com with ESMTPS id xf4si19322637pab.336.2014.02.02.22.57.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 02 Feb 2014 22:57:14 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.46 is neither permitted nor denied by best guess record for domain of takahiro.akashi@linaro.org) client-ip=209.85.220.46; Received: by mail-pa0-f46.google.com with SMTP id rd3so6664291pab.5 for ; Sun, 02 Feb 2014 22:57:12 -0800 (PST) X-Received: by 10.68.125.164 with SMTP id mr4mr35379193pbb.27.1391410632320; Sun, 02 Feb 2014 22:57:12 -0800 (PST) Received: from localhost.localdomain (KD182249091062.au-net.ne.jp. [182.249.91.62]) by mx.google.com with ESMTPSA id hb10sm52674868pbd.1.2014.02.02.22.57.07 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 02 Feb 2014 22:57:10 -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 Cc: arndb@arndb.de, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-audit@redhat.com, patches@linaro.org, AKASHI Takahiro Subject: [PATCH v3 2/3] arm64: Add audit support Date: Mon, 3 Feb 2014 15:56:29 +0900 Message-Id: <1391410590-4884-3-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1391410590-4884-1-git-send-email-takahiro.akashi@linaro.org> References: <1389946399-4525-1-git-send-email-takahiro.akashi@linaro.org> <1391410590-4884-1-git-send-email-takahiro.akashi@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: takahiro.akashi@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On AArch64, audit is supported through generic lib/audit.c and compat_audit.c, and so this patch adds arch specific definitions required. Signed-off-by: AKASHI Takahiro --- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/syscall.h | 15 +++++++++++++++ include/uapi/linux/audit.h | 1 + 3 files changed, 17 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 6d4dd22..3c21405 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -19,6 +19,7 @@ config ARM64 select GENERIC_SMP_IDLE_THREAD select GENERIC_TIME_VSYSCALL select HARDIRQS_SW_RESEND + select HAVE_ARCH_AUDITSYSCALL select HAVE_ARCH_TRACEHOOK select HAVE_DEBUG_BUGVERBOSE select HAVE_DEBUG_KMEMLEAK diff --git a/arch/arm64/include/asm/syscall.h b/arch/arm64/include/asm/syscall.h index 70ba9d4..6900183 100644 --- a/arch/arm64/include/asm/syscall.h +++ b/arch/arm64/include/asm/syscall.h @@ -16,7 +16,9 @@ #ifndef __ASM_SYSCALL_H #define __ASM_SYSCALL_H +#include #include +#include static inline int syscall_get_nr(struct task_struct *task, @@ -104,4 +106,17 @@ static inline void syscall_set_arguments(struct task_struct *task, memcpy(®s->regs[i], args, n * sizeof(args[0])); } +/* + * We don't care about endianness (__AUDIT_ARCH_LE bit) here because + * AArch64 has the same system calls both on little- and big- endian. + */ +static inline int syscall_get_arch(struct task_struct *task, + struct pt_regs *regs) +{ + if (is_compat_thread(task_thread_info(task))) + return AUDIT_ARCH_ARM; + + return AUDIT_ARCH_AARCH64; +} + #endif /* __ASM_SYSCALL_H */ diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h index 0a73cf3..cf27cae 100644 --- a/include/uapi/linux/audit.h +++ b/include/uapi/linux/audit.h @@ -327,6 +327,7 @@ enum { /* distinguish syscall tables */ #define __AUDIT_ARCH_64BIT 0x80000000 #define __AUDIT_ARCH_LE 0x40000000 +#define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) #define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) #define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE) #define AUDIT_ARCH_ARMEB (EM_ARM)