From patchwork Fri Jan 17 08:13:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 23292 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 93DA8202FA for ; Fri, 17 Jan 2014 08:14:17 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id hu8sf5810452vcb.6 for ; Fri, 17 Jan 2014 00:14:16 -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=hVXRfe4VTtjtVlz2jJ9s7L4zToPnne9r7s6ASlo7Gvs=; b=jR9dRNVp82Qo7V9Z6dIUWCoe93JTxBfT21z1av/bQ+hfVSWpW8+0oTE7kUs2TpfL89 L8ebcn65OeS9iTHiOJohZ2YxDJjN6WC+YPSjOddzA2MNuahMfJ0uE/jkCkjiKbLCdF82 BKxt/nb95ZWsSj4QtUIb5lwkrMCgLhdBXJ7ohyyWG4MqB8oIk6YU7JjP2ANNez0NKnaj RGMvPNMJJFVkKfgtqoeRr3f0+3OMsYyCIG6aJW0eTKsGVTaXu2Nu7FDEl5CYv6HVjhZa OgoAvIvHnMGsyamJDVmU6JJaVPNjJQqWq/OfEO15b0f2dwiaWxaDuhz9MQ0Dn/pSx72O BorA== X-Gm-Message-State: ALoCoQmNIaHjJUTPqDbQkOiKmbYwDyaKuIPZ7Wbb1inw+gHsdR8CiVcBz/05Bu/WM374S+GX6qUo X-Received: by 10.236.110.3 with SMTP id t3mr176248yhg.3.1389946456757; Fri, 17 Jan 2014 00:14:16 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.49.10 with SMTP id q10ls1069701qen.0.gmail; Fri, 17 Jan 2014 00:14:16 -0800 (PST) X-Received: by 10.58.226.163 with SMTP id rt3mr250621vec.34.1389946456641; Fri, 17 Jan 2014 00:14:16 -0800 (PST) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by mx.google.com with ESMTPS id s4si4552272vcy.61.2014.01.17.00.14.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Jan 2014 00:14:16 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.45 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.45; Received: by mail-vb0-f45.google.com with SMTP id m10so1390613vbh.4 for ; Fri, 17 Jan 2014 00:14:16 -0800 (PST) X-Received: by 10.58.161.46 with SMTP id xp14mr211313veb.37.1389946456549; Fri, 17 Jan 2014 00:14:16 -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 ey3csp2350ved; Fri, 17 Jan 2014 00:14:16 -0800 (PST) X-Received: by 10.66.121.164 with SMTP id ll4mr719284pab.48.1389946455652; Fri, 17 Jan 2014 00:14:15 -0800 (PST) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx.google.com with ESMTPS id o7si9435203pbb.340.2014.01.17.00.14.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Jan 2014 00:14:15 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.54 is neither permitted nor denied by best guess record for domain of takahiro.akashi@linaro.org) client-ip=209.85.220.54; Received: by mail-pa0-f54.google.com with SMTP id fa1so3786573pad.41 for ; Fri, 17 Jan 2014 00:14:15 -0800 (PST) X-Received: by 10.68.143.231 with SMTP id sh7mr628199pbb.7.1389946455213; Fri, 17 Jan 2014 00:14:15 -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.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Jan 2014 00:14:13 -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 4/6] arm64: audit: Add 32-bit (compat) syscall support Date: Fri, 17 Jan 2014 17:13:17 +0900 Message-Id: <1389946399-4525-5-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.212.45 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: , Generic audit code also support compat system calls now. This patch adds a small piece of architecture dependent code. Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/audit.h | 20 ++++++++++++++++++++ arch/arm64/include/asm/syscall.h | 10 ++++++++++ 2 files changed, 30 insertions(+) create mode 100644 arch/arm64/include/asm/audit.h diff --git a/arch/arm64/include/asm/audit.h b/arch/arm64/include/asm/audit.h new file mode 100644 index 0000000..70eef50 --- /dev/null +++ b/arch/arm64/include/asm/audit.h @@ -0,0 +1,20 @@ +/* + * arch/arm64/include/asm/audit.h + * + * Copyright (C) 2013 Linaro Limited + * Author: AKASHI Takahiro + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __ASM_AUDIT_H +#define __ASM_AUDIT_H + +#include + +#define audit_is_compat(arch) \ + ((arch == AUDIT_ARCH_ARM) || (arch == AUDIT_ARCH_ARMEB)) + +#endif /* __ASM_AUDIT_H */ diff --git a/arch/arm64/include/asm/syscall.h b/arch/arm64/include/asm/syscall.h index 3361fec..d7660e9 100644 --- a/arch/arm64/include/asm/syscall.h +++ b/arch/arm64/include/asm/syscall.h @@ -19,6 +19,7 @@ #include #include #include +#include static inline int syscall_get_nr(struct task_struct *task, @@ -109,6 +110,15 @@ static inline void syscall_set_arguments(struct task_struct *task, static inline int syscall_get_arch(struct task_struct *task, struct pt_regs *regs) { +#ifdef CONFIG_COMPAT + if (is_compat_thread(task_thread_info(task))) +#ifdef __AARCH64EB__ + return AUDIT_ARCH_ARMEB; /* only BE on BE */ +#else + return AUDIT_ARCH_ARM; +#endif +#endif + #ifdef __AARCH64EB__ return AUDIT_ARCH_AARCH64EB; #else