Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1370483imu; Fri, 9 Nov 2018 15:36:09 -0800 (PST) X-Google-Smtp-Source: AJdET5cbmxfPaPQwKMkKT0kvgioRG+xMpXpH5MoMZ60Xtx9CRBV2kmcHGvhgN4koplXU+jQjBSjT X-Received: by 2002:a62:a218:: with SMTP id m24-v6mr10654205pff.99.1541806569696; Fri, 09 Nov 2018 15:36:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541806569; cv=none; d=google.com; s=arc-20160816; b=0GQfp9OP3DMov+/MinzLGBe0Bdp7k2BZz/SJJHxBpUz76eaTOOcHYHnxud4edXbWbN T130WHb7U+AOyhBAiF1RGlloO0PF7iibBdRwRkZD83xv6P0LkTNtQz3HyQqsy1FiuKXp PnmFpmHWSm2wirYtwi5IDXIY6ttfMxBNk76A2QX6nU3eHlvlKBugo7dsK/y9Ht10O8Ls hXg1RU4Aqd7t91E6IwtxcvnhX9MKcGID8PhjmQa9uAnBIhmEb1JDDmnZ8QMztNHWqrUF qRPd1CPgfexY3YTf0TAEohIovtB3L8Qp7hKHX3jh5lw1uHxrw7QFvs7bBPmvdwtO3jUN pRgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date; bh=lbTzFz/q02vPpBVUrdw6VO14dGpw4pkR2106r8UEHVI=; b=dAXTFriJLwCj3zehgcX17tydRMmwB4wJuSrxD062BnhsqnLHKIqmO2GxPzy7mSiMIY eBRdtPJ+6earucr2p5g92KEyybl9SFmkdedae4Yv0BZqz4jCUvCXohD83wvfR23r3hUl 4wSXvmb2kJF5rwjAgH4/qJVJP8tOaZKiul5InLUJCANvbJbzhe3hqgPhsKvvEXAtTtX5 CUqDMHSqHVK+wYdOcR2dohCcVLI3y2yyp3xCpaM9Ft/28Lw5YUZwTpDwOpLHErP9d4yA sw7Jk3mx1t9ec7upecGbs+cMCCrq8cqtsme/WnEBK2fjk2gPEPjxvi3mLS/R6a1Ch8B5 V/LQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m38si8361493pgl.125.2018.11.09.15.35.54; Fri, 09 Nov 2018 15:36:09 -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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728862AbeKJJQd (ORCPT + 99 others); Sat, 10 Nov 2018 04:16:33 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:57932 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727557AbeKJJQd (ORCPT ); Sat, 10 Nov 2018 04:16:33 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id C459372CBF9; Sat, 10 Nov 2018 02:33:42 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id B92E87CD1FF; Sat, 10 Nov 2018 02:33:42 +0300 (MSK) Date: Sat, 10 Nov 2018 02:33:42 +0300 From: "Dmitry V. Levin" To: Andrew Lutomirski , Alexey Brodkin , Vineet Gupta Cc: Elvira Khabirova , Paul Moore , Eric Paris , linux-snps-arc@lists.infradead.org, linux-audit@redhat.com, linux-kernel@vger.kernel.org Subject: [PATCH 06/13 v2] arc: define syscall_get_arch() Message-ID: <20181109233342.GC2710@altlinux.org> Mail-Followup-To: Andrew Lutomirski , Alexey Brodkin , Vineet Gupta , Elvira Khabirova , Paul Moore , Eric Paris , linux-snps-arc@lists.infradead.org, linux-audit@redhat.com, linux-kernel@vger.kernel.org References: <20181109031605.GF21511@altlinux.org> <456a69c6e01a6ab5b1af6d459a249388f8b4c1f5.camel@synopsys.com> <215d66fd9a197b631973c9ff75943b4c1216b899.camel@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org syscall_get_arch() is required to be implemented on all architectures that use tracehook_report_syscall_entry() in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Signed-off-by: Dmitry V. Levin --- v2: define AUDIT_ARCH_ARCOMPACT, AUDIT_ARCH_ARCOMPACTLE, AUDIT_ARCH_ARCV2, and AUDIT_ARCH_ARCV2LE instead of AUDIT_ARCH_ARC, update syscall_get_arch() implementation accordingly. arch/arc/include/asm/syscall.h | 18 ++++++++++++++++++ include/uapi/linux/audit.h | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/arch/arc/include/asm/syscall.h b/arch/arc/include/asm/syscall.h index 29de09804306..a1b698290778 100644 --- a/arch/arc/include/asm/syscall.h +++ b/arch/arc/include/asm/syscall.h @@ -9,6 +9,7 @@ #ifndef _ASM_ARC_SYSCALL_H #define _ASM_ARC_SYSCALL_H 1 +#include #include #include #include @@ -68,4 +69,21 @@ syscall_get_arguments(struct task_struct *task, struct pt_regs *regs, } } +static inline int syscall_get_arch(void) +{ +#ifdef CONFIG_ISA_ARCOMPACT +# ifdef CONFIG_CPU_BIG_ENDIAN + return AUDIT_ARCH_ARCOMPACT; +# else + return AUDIT_ARCH_ARCOMPACTLE; +# endif +#else /* CONFIG_ISA_ARCV2 */ +# ifdef CONFIG_CPU_BIG_ENDIAN + return AUDIT_ARCH_ARCV2; +# else + return AUDIT_ARCH_ARCV2LE; +# endif +#endif +} + #endif diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h index 818ae690ab79..8e70fb70b8f8 100644 --- a/include/uapi/linux/audit.h +++ b/include/uapi/linux/audit.h @@ -375,6 +375,10 @@ enum { #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_ARCOMPACT (EM_ARCOMPACT) +#define AUDIT_ARCH_ARCOMPACTLE (EM_ARCOMPACT|__AUDIT_ARCH_LE) +#define AUDIT_ARCH_ARCV2 (EM_ARCV2) +#define AUDIT_ARCH_ARCV2LE (EM_ARCV2|__AUDIT_ARCH_LE) #define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE) #define AUDIT_ARCH_ARMEB (EM_ARM) #define AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE) -- ldv