From patchwork Thu Mar 13 10:16:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 26191 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 89D67206A0 for ; Thu, 13 Mar 2014 10:16:53 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id rd18sf2839204iec.4 for ; Thu, 13 Mar 2014 03:16:53 -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=SozpqdYv3DO6I22J/fKc3RdYoh3JSzY0E7XBsQKYTHU=; b=ca5a74N/cuKoII0wdOKvRkGS7Qm3LrTkRuXed917JfCWdp+skNmSLXRo4o6tqjRFoY jvCsiyI6O+appioJiH7QE+OVkT6Yw53RDkBB/37K0J58NhhWVlwOUZ8jhakHoy47eC2+ HOX8J3r91tCh7H4x297VkasJw/kBnDw8VnKkfjuKIwJy0Rv1O+v+LVNUfI6YdN3IYvcB L8yjqHnd2s1Sjn2T10m3U5upML7/BVqEZSE2uZVGaq1+7H+f73plZvPScL+tV6jA+wAZ xeRGkf6pQceWXr6eVZ+Gkud8yedh+RqF7OZ4imGAye1kbZtPnkA2/5zgxOJsDw9k6v/Y amfg== X-Gm-Message-State: ALoCoQmrV4346IPNYjEGFe09gDVgXo2OF5n3+xxFy/Y26Y4R+nTxYJ51aH6JjMco0L0e9W83P+IA X-Received: by 10.43.163.199 with SMTP id mp7mr357192icc.6.1394705813045; Thu, 13 Mar 2014 03:16:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.70 with SMTP id l64ls221426qge.16.gmail; Thu, 13 Mar 2014 03:16:52 -0700 (PDT) X-Received: by 10.221.74.65 with SMTP id yv1mr154483vcb.31.1394705812878; Thu, 13 Mar 2014 03:16:52 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id sr19si611844vcb.71.2014.03.13.03.16.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Mar 2014 03:16:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 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.182; Received: by mail-vc0-f182.google.com with SMTP id ks9so853665vcb.27 for ; Thu, 13 Mar 2014 03:16:52 -0700 (PDT) X-Received: by 10.220.67.18 with SMTP id p18mr744812vci.14.1394705812341; Thu, 13 Mar 2014 03:16:52 -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.78.9 with SMTP id i9csp356008vck; Thu, 13 Mar 2014 03:16:51 -0700 (PDT) X-Received: by 10.68.224.195 with SMTP id re3mr1191436pbc.93.1394705811418; Thu, 13 Mar 2014 03:16:51 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zo6si1827488pbc.103.2014.03.13.03.16.50; Thu, 13 Mar 2014 03:16:50 -0700 (PDT) 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 S1754007AbaCMKQh (ORCPT + 26 others); Thu, 13 Mar 2014 06:16:37 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:60866 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753543AbaCMKQb (ORCPT ); Thu, 13 Mar 2014 06:16:31 -0400 Received: by mail-pd0-f180.google.com with SMTP id v10so872059pde.25 for ; Thu, 13 Mar 2014 03:16:31 -0700 (PDT) X-Received: by 10.68.197.99 with SMTP id it3mr1224431pbc.37.1394705790945; Thu, 13 Mar 2014 03:16:30 -0700 (PDT) Received: from localhost.localdomain (KD182249091179.au-net.ne.jp. [182.249.91.179]) by mx.google.com with ESMTPSA id pi1sm7591558pac.14.2014.03.13.03.16.24 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Mar 2014 03:16:30 -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 v7 1/2] arm64: Add audit support Date: Thu, 13 Mar 2014 19:16:06 +0900 Message-Id: <1394705767-12423-2-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1394705767-12423-1-git-send-email-takahiro.akashi@linaro.org> References: <1393564635-3921-1-git-send-email-takahiro.akashi@linaro.org> <1394705767-12423-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.182 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 b1dcdb4..7ca6799 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_C_RECORDMCOUNT diff --git a/arch/arm64/include/asm/syscall.h b/arch/arm64/include/asm/syscall.h index 383771e..ce3882f 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 extern const void *sys_call_table[]; @@ -105,4 +107,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)