Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp967806imu; Fri, 9 Nov 2018 08:51:07 -0800 (PST) X-Google-Smtp-Source: AJdET5fF5P4rC4SIBt6XPHS2C2FZRuGdmVYSeh0Z5ePmuOftmOLEecGIh15z5lidsq9C/RAkrm6l X-Received: by 2002:a17:902:59dd:: with SMTP id d29-v6mr9815036plj.193.1541782266994; Fri, 09 Nov 2018 08:51:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541782266; cv=none; d=google.com; s=arc-20160816; b=DeOG3LnCMlbqYOOsazLEyuowZuM5jfInSXpIxmBGYoAKej1sjUEPZPzP1wVVGsr3JN riYNMBid5AP5lrExr5rpD6uqT8SONCQbO6SUMPGxlUPDPZYf2nlYnjw/BxpIqSP/ZCu1 C00zpsiUnsIfJXzMkfqwnrOZIw0swE+jQf6ENAyd/LS7Zk52nOtCUXCSIAz5UKkfehis 78N4tM3FTFaBZgpOeBQHhZ9U3Zt68EcjmQjwpWwQpGnvY8MnUKbJ3QoT3G1yxxdn8sys sYSZuXBIOUi/mRkga2Zs7qUZ9zN4BhbEOhDLUXvG2gHxvh9dUDBBAMMmJluscfPCfYjN eyrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=XFE4zY7cMmT1iYZmyF4hc8IP2tblZjYQhq5elC7xK44=; b=aZeBkNNvuWwpuQePf8B1ktVeh/bevmHPS5tet7HaBbjWGzFxHRqS94WofYrhxrTDhP wluAjwdxx+jPHmlayyA9sfvARE2CH9PGuFrHHwfG8UvuPZ/ZLTXEEgG6MZBKTocVGOdi YpMl2QM+ROylEPG3B4Sk+KznxiOprfTwwHibaFq3seCuPNx3N9vTTl779NEoktjMyYED kcFiFi53JCx8+qs+AmIusS/6rhSarBPeeP9zIR3PM9G36OnRWz7d3c6U+VS/HWdDgKwH PkpO+cDHmZC9lVjrFasJUwwP2LgJxz8Pc2RdZW24Q52p6cs3BRIeZqZ6/K0Vld3glkPb AIXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=ADj5ptem; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k3-v6si8372177pld.25.2018.11.09.08.50.38; Fri, 09 Nov 2018 08:51:06 -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; dkim=pass header.i=@synopsys.com header.s=mail header.b=ADj5ptem; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728380AbeKJCbd (ORCPT + 99 others); Fri, 9 Nov 2018 21:31:33 -0500 Received: from smtprelay4.synopsys.com ([198.182.47.9]:56114 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727955AbeKJCbd (ORCPT ); Fri, 9 Nov 2018 21:31:33 -0500 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id B7DB424E0D1A; Fri, 9 Nov 2018 08:50:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1541782211; bh=D+fj4bVA05n295NozqYkKR7cMfAh541g8rYlP7avEuA=; h=From:To:CC:Subject:Date:References:From; b=ADj5ptemN5XIVa4dmwrElFmFoxGDS74gYUsPz+aG2hAczAWi7w4EV589SefRFDWjK Av1qPauK0qPAORVKRo6NPUIsaQTWUumLiLYLGRrHqPUgh12osdODbPI/zf2FhmVmKA Vmm2KvrqoLl3apuJ0bA3EWPwVimMT21dsKb/fhBpC2WO3cUgqubMfeKWbTvgiSpzhd VitW05pxQjJmzTofsvFYXFR9JwIRdh/KXbHuv33hJ7YNflrR/gJ/PlnHLePR6hCeUM h2e5P9UW8OHLeP5EvkTuDDHd7HE9F1w9ZR72RgbwXqqzrnE212NQuv86q1dkfvwfy/ DHBOgLIm2tK/A== Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) by mailhost.synopsys.com (Postfix) with ESMTP id C4A573D47; Fri, 9 Nov 2018 08:50:09 -0800 (PST) Received: from us01wembx1.internal.synopsys.com ([169.254.1.228]) by US01WEHTC3.internal.synopsys.com ([::1]) with mapi id 14.03.0415.000; Fri, 9 Nov 2018 08:50:09 -0800 From: Vineet Gupta To: "Dmitry V. Levin" , Andy Lutomirski , Paul Moore , Eric Paris CC: Elvira Khabirova , "linux-snps-arc@lists.infradead.org" , "linux-audit@redhat.com" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 06/13] arc: define syscall_get_arch() Thread-Topic: [PATCH 06/13] arc: define syscall_get_arch() Thread-Index: AQHUd9qPWfzlAeDkY06iwsmGassPrQ== Date: Fri, 9 Nov 2018 16:50:09 +0000 Message-ID: References: <20181109031605.GF21511@altlinux.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.144.199.104] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/8/18 7:16 PM, Dmitry V. Levin wrote:=0A= > syscall_get_arch() is required to be implemented on all architectures=0A= > that use tracehook_report_syscall_entry() in order to extend=0A= > the generic ptrace API with PTRACE_GET_SYSCALL_INFO request.=0A= >=0A= > Signed-off-by: Dmitry V. Levin =0A= > ---=0A= > arch/arc/include/asm/syscall.h | 6 ++++++=0A= > include/uapi/linux/audit.h | 1 +=0A= > 2 files changed, 7 insertions(+)=0A= >=0A= > diff --git a/arch/arc/include/asm/syscall.h b/arch/arc/include/asm/syscal= l.h=0A= > index 29de09804306..5662778a7411 100644=0A= > --- a/arch/arc/include/asm/syscall.h=0A= > +++ b/arch/arc/include/asm/syscall.h=0A= > @@ -9,6 +9,7 @@=0A= > #ifndef _ASM_ARC_SYSCALL_H=0A= > #define _ASM_ARC_SYSCALL_H 1=0A= > =0A= > +#include =0A= > #include =0A= > #include =0A= > #include =0A= > @@ -68,4 +69,9 @@ syscall_get_arguments(struct task_struct *task, struct = pt_regs *regs,=0A= > }=0A= > }=0A= > =0A= > +static inline int syscall_get_arch(void)=0A= > +{=0A= > + return AUDIT_ARCH_ARC;=0A= > +}=0A= > +=0A= =0A= Does ptrace (or user of this API) need a unique value per arch. Otherwise i= nstead=0A= of adding the boilerplate code to all arches, they could simply define AUDI= T_ARCH=0A= and common code could return it. Also the EM_xxx are not there in=0A= include/uapi/linux/elf.h to begin with since libc elf.h already defines the= m.=0A= =0A= > #endif=0A= > diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h=0A= > index 818ae690ab79..a7149ceb5b98 100644=0A= > --- a/include/uapi/linux/audit.h=0A= > +++ b/include/uapi/linux/audit.h=0A= > @@ -375,6 +375,7 @@ enum {=0A= > =0A= > #define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_L= E)=0A= > #define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)= =0A= > +#define AUDIT_ARCH_ARC (EM_ARC)=0A= > #define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE)=0A= > #define AUDIT_ARCH_ARMEB (EM_ARM)=0A= > #define AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE)=0A= =0A= So I don't have the context of this patch (or coverletter) but what exactly= are we=0A= trying to do with this (adding LE to audit) - what happens when an arch is= =0A= capable of either and is say built for BE ?=0A=