From patchwork Wed Apr 30 09:57:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 29402 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f71.google.com (mail-qg0-f71.google.com [209.85.192.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 75ED2203F3 for ; Wed, 30 Apr 2014 09:58:45 +0000 (UTC) Received: by mail-qg0-f71.google.com with SMTP id j5sf3099270qga.10 for ; Wed, 30 Apr 2014 02:58: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:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=n1X7zUET1EeCpXIDwx8x9HezgVTSoMCskij4436EwGA=; b=aKhY8xxXPkVEOWY0PeJzGyOKQUKy2GTTDwuN0k1p8OyoYo2AAUJgOeihxHPrTnFL0q TjjJpol5sdJc47NtBtZ/b0Ilq6UiUlAQ+voRA9jLBiO/PMPd26V9AsqFK4+uD0lEib/K i3Yjbkr8qLVZffGAwQV8Huw9cu/J59nnwa+hUqqUzk5w+o/G8DmB3qmsaCULRCFfl+uf J0XP+rvU5U+nrjhGTgAn5JjbjEwKEyHAr2V6hJRDVN4QXMjzmS7QI7a2Ca+v0kY8lAiZ /S8v+K7plyL4qHDFo0iBflqxOsgDexr/Mb8vJQiGU7lXeLG5s0jRdhFzVIvwfkkPLDKG fTZA== X-Gm-Message-State: ALoCoQnro8PxJM2vDCibCDcYwu8bVWtp+5JHWJzSJZ8GIEsFkGNC2yU68ZsgQlnd7eAwOfvUoQQF X-Received: by 10.58.95.98 with SMTP id dj2mr1735896veb.30.1398851925196; Wed, 30 Apr 2014 02:58:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.107 with SMTP id b98ls535378qgd.64.gmail; Wed, 30 Apr 2014 02:58:45 -0700 (PDT) X-Received: by 10.52.95.135 with SMTP id dk7mr2616163vdb.32.1398851925106; Wed, 30 Apr 2014 02:58:45 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id vd8si5189983vdc.196.2014.04.30.02.58.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Apr 2014 02:58:45 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id pa12so853165veb.4 for ; Wed, 30 Apr 2014 02:58:45 -0700 (PDT) X-Received: by 10.220.147.16 with SMTP id j16mr3202872vcv.14.1398851924946; Wed, 30 Apr 2014 02:58:44 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp265471vcb; Wed, 30 Apr 2014 02:58:44 -0700 (PDT) X-Received: by 10.66.155.7 with SMTP id vs7mr7066755pab.42.1398851923852; Wed, 30 Apr 2014 02:58:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ck1si16381473pad.163.2014.04.30.02.58.43 for ; Wed, 30 Apr 2014 02:58:43 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933684AbaD3J6j (ORCPT + 28 others); Wed, 30 Apr 2014 05:58:39 -0400 Received: from mail-ie0-f171.google.com ([209.85.223.171]:64832 "EHLO mail-ie0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932198AbaD3J6f (ORCPT ); Wed, 30 Apr 2014 05:58:35 -0400 Received: by mail-ie0-f171.google.com with SMTP id to1so1647540ieb.16 for ; Wed, 30 Apr 2014 02:58:35 -0700 (PDT) X-Received: by 10.50.39.111 with SMTP id o15mr3243010igk.1.1398851914990; Wed, 30 Apr 2014 02:58:34 -0700 (PDT) Received: from localhost.localdomain (KD182249095136.au-net.ne.jp. [182.249.95.136]) by mx.google.com with ESMTPSA id on9sm4435618igb.11.2014.04.30.02.58.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Apr 2014 02:58:34 -0700 (PDT) From: AKASHI Takahiro To: viro@zeniv.linux.org.uk, eparis@redhat.com, rgb@redhat.com, catalin.marinas@arm.com, will.deacon@arm.com Cc: dsaxena@linaro.org, arndb@arndb.de, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-audit@redhat.com, AKASHI Takahiro Subject: [PATCH v9 1/2] arm64: Add audit support Date: Wed, 30 Apr 2014 18:57:22 +0900 Message-Id: <1398851843-16435-2-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1398851843-16435-1-git-send-email-takahiro.akashi@linaro.org> References: <1394862548-29060-1-git-send-email-takahiro.akashi@linaro.org> <1398851843-16435-1-git-send-email-takahiro.akashi@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.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: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org 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. Acked-by Will Deacon Acked-by: Richard Guy Briggs Signed-off-by: AKASHI Takahiro --- arch/arm64/Kconfig | 2 ++ arch/arm64/include/asm/syscall.h | 14 ++++++++++++++ include/uapi/linux/audit.h | 1 + 3 files changed, 17 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 0e9b8ce..0d3a003 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -9,6 +9,7 @@ config ARM64 select ARM_AMBA select ARM_ARCH_TIMER select ARM_GIC + select AUDIT_ARCH_COMPAT_GENERIC select BUILDTIME_EXTABLE_SORT select CLONE_BACKWARDS select COMMON_CLK @@ -27,6 +28,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_KGDB select HAVE_ARCH_TRACEHOOK diff --git a/arch/arm64/include/asm/syscall.h b/arch/arm64/include/asm/syscall.h index 383771e..709a574 100644 --- a/arch/arm64/include/asm/syscall.h +++ b/arch/arm64/include/asm/syscall.h @@ -16,6 +16,8 @@ #ifndef __ASM_SYSCALL_H #define __ASM_SYSCALL_H +#include +#include #include extern const void *sys_call_table[]; @@ -105,4 +107,16 @@ 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(void) +{ + if (is_compat_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 11917f7..e7df2e3 100644 --- a/include/uapi/linux/audit.h +++ b/include/uapi/linux/audit.h @@ -334,6 +334,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)