From patchwork Fri Feb 7 10:10:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 24280 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 686642096A for ; Fri, 7 Feb 2014 10:10:52 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id fp1sf3980092pdb.6 for ; Fri, 07 Feb 2014 02:10:51 -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=t4Wm650ApmRDgd0DdlX33XtnCTvuJM9h1WPrapkg2Uo=; b=jMMvHXnpdcekQQjae8hnv7DpnXEsgoiaCVdMwIwXN0g/zwh1hgNrcZN++Y9czvsJcz YercMAoJuk8qOKhyhxGUBwkd7Yu071ZWfdj+v6n01cugJ/Xo2gU1GpsakAIIlzbYpmFU gkwFmL9JRfx3w5b8OIaGbQjMTJx33zMgep4r2txhr1+RrTrKCoj9BqD+C0EPzx492Bct q493UcC7OJTI3WWP+ZleDZcHopdQjTxNlS/y0TGJFct8oz6bYRae8frOrDetkGaqjo+u 22PpDMwbQjmPAUb37pVWlCtbVkbx5CvFmCkAwvp6opzNityhaBp4fQwOo6J9KJRWMZ8J pUxg== X-Gm-Message-State: ALoCoQmfYOg/SzeT3aikv8KMxxBORfN0lWDG+9H1btCGXtGB1LbGIBaSST6ST8v7s32tQCs5l74p X-Received: by 10.67.3.34 with SMTP id bt2mr2654273pad.16.1391767851511; Fri, 07 Feb 2014 02:10:51 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.26.195 with SMTP id 61ls912762qgv.19.gmail; Fri, 07 Feb 2014 02:10:51 -0800 (PST) X-Received: by 10.220.11.141 with SMTP id t13mr705127vct.30.1391767851422; Fri, 07 Feb 2014 02:10:51 -0800 (PST) Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by mx.google.com with ESMTPS id e5si1154553vcf.146.2014.02.07.02.10.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Feb 2014 02:10:51 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.46 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.46; Received: by mail-vb0-f46.google.com with SMTP id o19so2414331vbm.19 for ; Fri, 07 Feb 2014 02:10:51 -0800 (PST) X-Received: by 10.220.109.1 with SMTP id h1mr9720410vcp.20.1391767851272; Fri, 07 Feb 2014 02:10:51 -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 u4csp91051vcz; Fri, 7 Feb 2014 02:10:50 -0800 (PST) X-Received: by 10.66.163.2 with SMTP id ye2mr6677422pab.110.1391767849990; Fri, 07 Feb 2014 02:10:49 -0800 (PST) Received: from mail-pb0-f45.google.com (mail-pb0-f45.google.com [209.85.160.45]) by mx.google.com with ESMTPS id zk9si4451204pac.202.2014.02.07.02.10.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Feb 2014 02:10:49 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.45 is neither permitted nor denied by best guess record for domain of takahiro.akashi@linaro.org) client-ip=209.85.160.45; Received: by mail-pb0-f45.google.com with SMTP id un15so3058645pbc.32 for ; Fri, 07 Feb 2014 02:10:49 -0800 (PST) X-Received: by 10.69.0.10 with SMTP id au10mr18866003pbd.48.1391767849619; Fri, 07 Feb 2014 02:10:49 -0800 (PST) Received: from localhost.localdomain (KD182249085115.au-net.ne.jp. [182.249.85.115]) by mx.google.com with ESMTPSA id oa3sm12004141pbb.15.2014.02.07.02.10.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Feb 2014 02:10:48 -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 v4 2/3] arm64: Add audit support Date: Fri, 7 Feb 2014 19:10:02 +0900 Message-Id: <1391767803-5350-3-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1391767803-5350-1-git-send-email-takahiro.akashi@linaro.org> References: <1391410590-4884-1-git-send-email-takahiro.akashi@linaro.org> <1391767803-5350-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.212.46 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 Acked-by Will Deacon --- 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 dd4327f..a21455e 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -25,6 +25,7 @@ config ARM64 select GENERIC_STRNLEN_USER select GENERIC_TIME_VSYSCALL select HARDIRQS_SW_RESEND + select HAVE_ARCH_AUDITSYSCALL select HAVE_ARCH_JUMP_LABEL select HAVE_ARCH_TRACEHOOK select HAVE_DEBUG_BUGVERBOSE 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 624df43..aa86fab 100644 --- a/include/uapi/linux/audit.h +++ b/include/uapi/linux/audit.h @@ -333,6 +333,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)