From patchwork Fri Jan 17 08:13:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 23291 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f199.google.com (mail-ig0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B6CCE202FA for ; Fri, 17 Jan 2014 08:14:10 +0000 (UTC) Received: by mail-ig0-f199.google.com with SMTP id c10sf1517078igq.2 for ; Fri, 17 Jan 2014 00:14:10 -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=44Mvamj60B7Zry+bHaJJY82dsi5jJxV5oxBt3LLlliM=; b=CvevIlhHZ2hS/iof0QseyTnKN6KOBsH5FgBt6hqRj2T57bfVV0/zHXIcrzAV8T0+Bx 2uLrwIMNO1n6Yc/YHg9A23YGIqvFkuJWo1QjI+li4PTInaLljCGCpriBo4aJr6sdzrDR 291weh94eC1+5ct+R4XFSiH0q54WcGzqFmkE0D0i0lN7xFFkz5LZtojideYgR25upER6 mezXJzcqqxyXIGVgNJyZdL1jRH/Dp+vuyPnExnmw3JJj9jR55d3+uZEZ5AsgP6/PS3ve bddgheMj872Khe8yDT+LBWhma3BH/oy2f5B7jj4q+jh7KXzIJGe8N4Pi//VggXxNsG79 hnLQ== X-Gm-Message-State: ALoCoQkpNgXV04ETQUSKtLBNKr8yPoBrcGMGm6Mv46cHlkufu3b2NqvkkBL8BDgz4GJGJpaJ52KW X-Received: by 10.182.246.39 with SMTP id xt7mr214829obc.40.1389946449988; Fri, 17 Jan 2014 00:14:09 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.47.48 with SMTP id a16ls1188929qen.26.gmail; Fri, 17 Jan 2014 00:14:09 -0800 (PST) X-Received: by 10.220.139.136 with SMTP id e8mr248251vcu.34.1389946449873; Fri, 17 Jan 2014 00:14:09 -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 xn9si4556666vcb.41.2014.01.17.00.14.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Jan 2014 00:14:09 -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 hu8so1457379vcb.1 for ; Fri, 17 Jan 2014 00:14:09 -0800 (PST) X-Received: by 10.220.139.136 with SMTP id e8mr248248vcu.34.1389946449810; Fri, 17 Jan 2014 00:14:09 -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.59.13.131 with SMTP id ey3csp2343ved; Fri, 17 Jan 2014 00:14:09 -0800 (PST) X-Received: by 10.68.164.4 with SMTP id ym4mr591858pbb.53.1389946448938; Fri, 17 Jan 2014 00:14:08 -0800 (PST) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by mx.google.com with ESMTPS id fv4si9445815pbd.242.2014.01.17.00.14.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Jan 2014 00:14:08 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.176 is neither permitted nor denied by best guess record for domain of takahiro.akashi@linaro.org) client-ip=209.85.192.176; Received: by mail-pd0-f176.google.com with SMTP id r10so3701685pdi.21 for ; Fri, 17 Jan 2014 00:14:08 -0800 (PST) X-Received: by 10.66.246.130 with SMTP id xw2mr695636pac.84.1389946448513; Fri, 17 Jan 2014 00:14:08 -0800 (PST) Received: from localhost.localdomain (KD182250177246.au-net.ne.jp. [182.250.177.246]) by mx.google.com with ESMTPSA id jn12sm20572056pbd.37.2014.01.17.00.14.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Jan 2014 00:14:07 -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 v2 3/6] arm64: Add audit support Date: Fri, 17 Jan 2014 17:13:16 +0900 Message-Id: <1389946399-4525-4-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1389946399-4525-1-git-send-email-takahiro.akashi@linaro.org> References: <1383733546-2846-1-git-send-email-takahiro.akashi@linaro.org> <1389946399-4525-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.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 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 can be enabled with CONFIG_AUDIT_GENERIC. Most of audit features are implemented in generic way. This patch adds a small piece of architecture dependent code. syscall_get_arch(), which is used in seccomp, should just return AUDIT_ARCH_*. Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/syscall.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/include/asm/syscall.h b/arch/arm64/include/asm/syscall.h index 70ba9d4..3361fec 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,14 @@ static inline void syscall_set_arguments(struct task_struct *task, memcpy(®s->regs[i], args, n * sizeof(args[0])); } +static inline int syscall_get_arch(struct task_struct *task, + struct pt_regs *regs) +{ +#ifdef __AARCH64EB__ + return AUDIT_ARCH_AARCH64EB; +#else + return AUDIT_ARCH_AARCH64; +#endif +} + #endif /* __ASM_SYSCALL_H */