From patchwork Fri Feb 28 05:17:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 25502 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E02842055D for ; Fri, 28 Feb 2014 05:18:18 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id p10sf514412pdj.11 for ; Thu, 27 Feb 2014 21:18:18 -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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=yTPDbZUOrVRUbICvtPOKQQ1m5gVA1GcHLd07hhdHW4Y=; b=BjKeGgXGeALaUFu6pf2/3Z6mR9FKqcSgjaXSKiNKznUWSDgOw6SB/8AW7gEC1kWZ3r 2IrG+bvG8qlBPmS8d7N6GPZhZywL2YmQIZOuor4fkuzLFHUxlNvJTzOrt0ynHjYJO2sJ 5+qB6piYIDaOLrulbChL/i4X7c1OEJiwikYwfEuXT1louos/TV/MdrB46qfUVOLKVus+ x/ulvzUiWvK3u9Ymw2u51BjXevrAU1INE0Xm8yd6be9J1Q9cUR/4NN7dNpRjWFO/ch9x uHZ+cEEJNxm8Ao3/MkSqgNi0WD1/Pgz7gLiGXro374NaaEG5sKgneQoafTu737aD51ge NnHw== X-Gm-Message-State: ALoCoQn3Hbv9K6SOpOT6pSoElfjnuxfIJLMTC0MWNian4H276bMq/zLPkG6/5TOwklswtX24J+Ik X-Received: by 10.66.240.4 with SMTP id vw4mr388308pac.10.1393564698074; Thu, 27 Feb 2014 21:18:18 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.51.130 with SMTP id u2ls1026877qga.34.gmail; Thu, 27 Feb 2014 21:18:17 -0800 (PST) X-Received: by 10.58.207.13 with SMTP id ls13mr783752vec.13.1393564697945; Thu, 27 Feb 2014 21:18:17 -0800 (PST) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id n17si1132782vcq.135.2014.02.27.21.18.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Feb 2014 21:18:17 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.170 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.170; Received: by mail-vc0-f170.google.com with SMTP id hu8so235556vcb.15 for ; Thu, 27 Feb 2014 21:18:17 -0800 (PST) X-Received: by 10.220.88.204 with SMTP id b12mr779453vcm.3.1393564697870; Thu, 27 Feb 2014 21:18:17 -0800 (PST) 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.130.193 with SMTP id u1csp28851vcs; Thu, 27 Feb 2014 21:18:17 -0800 (PST) X-Received: by 10.66.250.161 with SMTP id zd1mr1235856pac.136.1393564696751; Thu, 27 Feb 2014 21:18:16 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mo4si637562pbc.51.2014.02.27.21.18.16; Thu, 27 Feb 2014 21:18:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751714AbaB1FSI (ORCPT + 26 others); Fri, 28 Feb 2014 00:18:08 -0500 Received: from mail-pb0-f45.google.com ([209.85.160.45]:56186 "EHLO mail-pb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751661AbaB1FSF (ORCPT ); Fri, 28 Feb 2014 00:18:05 -0500 Received: by mail-pb0-f45.google.com with SMTP id un15so266533pbc.32 for ; Thu, 27 Feb 2014 21:18:05 -0800 (PST) X-Received: by 10.68.171.4 with SMTP id aq4mr1218563pbc.150.1393564684950; Thu, 27 Feb 2014 21:18:04 -0800 (PST) Received: from localhost.localdomain (KD182249084248.au-net.ne.jp. [182.249.84.248]) by mx.google.com with ESMTPSA id hc4sm1758862pbc.29.2014.02.27.21.17.58 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Feb 2014 21:18:04 -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: 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 v6 1/2] arm64: Add audit support Date: Fri, 28 Feb 2014 14:17:14 +0900 Message-Id: <1393564635-3921-2-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393564635-3921-1-git-send-email-takahiro.akashi@linaro.org> References: <1393319934-2810-1-git-send-email-takahiro.akashi@linaro.org> <1393564635-3921-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: 209.85.220.170 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 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 | 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 27bbcfc..aa47548 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)