From patchwork Tue Feb 25 09:18:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 25249 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C080120558 for ; Tue, 25 Feb 2014 09:19:55 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id w8sf182064qac.4 for ; Tue, 25 Feb 2014 01:19:55 -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=dIbzD/2o7oSIyMVvqOcWFtQL9a8bTi3W4O2USiI71oQ=; b=eWorGgnEz/stfP4wvphIw48qAyJNlOC2CXd39ZSEQZWRVYmH66IguzMFl1w1f57VNa xhadRUNr5IvIJisJySDUg1IbPqXZkuZtcRNUCGOuOMdQz0UfvY6Zt8uWrni7GHjU32eP uzhiK8R4jKnnQfnVohV7GDzHr5OZSctAIshaBrc7qsGY3KL5YwMZ8M3ui5+voM/Sr9HH DqEwzplgyfAMTc9yX9ts3tNIxm7JeqlGEAEr7aEhOzneHzu8tnJfK+ExqUVatq2zzJHV C7NlflF5/VMRkTbgQlOdvVGDkKNsyOqiwUKAt+hOETKjHMWr/ndjodwPK3K1w9YLahUi z9XA== X-Gm-Message-State: ALoCoQlOtl9zlAfWwQLAOOHcDdsfh2e5hf/5hvhypq1R2+aCPFgkLZZc+8ORVvzQi5TyAqKxu+k/ X-Received: by 10.58.213.132 with SMTP id ns4mr111750vec.27.1393319995524; Tue, 25 Feb 2014 01:19:55 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.134 with SMTP id u6ls2290012qge.79.gmail; Tue, 25 Feb 2014 01:19:55 -0800 (PST) X-Received: by 10.52.81.66 with SMTP id y2mr71401vdx.23.1393319994826; Tue, 25 Feb 2014 01:19:54 -0800 (PST) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id kn6si6652966veb.130.2014.02.25.01.19.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 01:19:54 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id pa12so112497veb.7 for ; Tue, 25 Feb 2014 01:19:54 -0800 (PST) X-Received: by 10.58.161.227 with SMTP id xv3mr142091veb.31.1393319994736; Tue, 25 Feb 2014 01:19:54 -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.174.196 with SMTP id u4csp123683vcz; Tue, 25 Feb 2014 01:19:54 -0800 (PST) X-Received: by 10.66.119.136 with SMTP id ku8mr379872pab.121.1393319993220; Tue, 25 Feb 2014 01:19:53 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mo4si2928905pbc.261.2014.02.25.01.19.52; Tue, 25 Feb 2014 01:19:52 -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 S1752926AbaBYJTn (ORCPT + 26 others); Tue, 25 Feb 2014 04:19:43 -0500 Received: from mail-pd0-f180.google.com ([209.85.192.180]:36243 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752757AbaBYJTj (ORCPT ); Tue, 25 Feb 2014 04:19:39 -0500 Received: by mail-pd0-f180.google.com with SMTP id y10so1904924pdj.39 for ; Tue, 25 Feb 2014 01:19:38 -0800 (PST) X-Received: by 10.68.11.199 with SMTP id s7mr5476230pbb.12.1393319978653; Tue, 25 Feb 2014 01:19:38 -0800 (PST) Received: from localhost.localdomain (KD182249093189.au-net.ne.jp. [182.249.93.189]) by mx.google.com with ESMTPSA id ix2sm8351685pbc.45.2014.02.25.01.19.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 01:19:37 -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 v5 2/3] arm64: Add audit support Date: Tue, 25 Feb 2014 18:18:53 +0900 Message-Id: <1393319934-2810-3-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393319934-2810-1-git-send-email-takahiro.akashi@linaro.org> References: <1391767803-5350-1-git-send-email-takahiro.akashi@linaro.org> <1393319934-2810-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.128.176 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. Signed-off-by: AKASHI Takahiro Acked-by Will Deacon Acked-by: Richard Guy Briggs --- 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)