Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1113029imu; Fri, 9 Nov 2018 11:07:58 -0800 (PST) X-Google-Smtp-Source: AJdET5c81N0vjdNR1aBkEY/BnqK5QerldcQqD9BYdjjW2pa1wQB9B6i8By2nPcFu1uI0LeQx8Jl5 X-Received: by 2002:a17:902:292b:: with SMTP id g40-v6mr9513912plb.279.1541790477957; Fri, 09 Nov 2018 11:07:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541790477; cv=none; d=google.com; s=arc-20160816; b=qBK+H8bU/phmZBEEM94YV/R9uv+Ip5vkj9mZQr5ciOjbO1Dk9AzPdXNBO85YUduU+T JvrDhefRw1VfCCTsZSfhYaBb8JiIOeY4pQe1Fi9Nhx7D1sAkFoyTTKGJolqztDWnfjWP uvbeVvBs9Rp7CyKJu0Gv0q1TcaoA6tApJCyydvrlV0i4creVKBziF57I0Bcu00jlCIQu xgZqptreimvzIzyVDUf4cEginVVZitT4bVa3dsu54i8d2ZrbGGjvdY68K52BF3UJoGzS FVmQNivl54jzucCbZF4T9g5q8x9HkyvoFmZ4orGCFS89nGNC6ipL0DA0ISYNXuCJTXRR Q87w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=yn2ADpYGFJB8QoUsSxyXC9rSSLPefLmyAe8EvMBchbQ=; b=kbU6eU0uA073xuqx0KbIsc01xM0IN9hlvIhxxgEPkHQXblZyZOam0CBtppD3Bf7YT8 YjMKaI0ubNyDjWSWlwtfYPwyr4Sgxld2bx6oir87OmKyGnkd0t2qjSbZNO3M34ZPYqcu QGo6/Ab0BRIzqS9yUtb4beiaJrvaRHyQwUprP60o4qMAqWiuhdJ4WqaYOX7/bwGY0KPg uphWzNlppvR4Drn6hd2/BZYqC2PZzjyQDgW+fEmvxUFQeFQGkNBtuzfyEmS9mI0fE1gQ Lm4ZkjQcCz3Mh+wmS1j0ceaOEebsyDEe8GHdgPq/aAYC7ppzW4RQsLYSuJj6YiRhAeT5 ljAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=uzfgwJ7F; 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 b4-v6si9167882pfa.25.2018.11.09.11.07.30; Fri, 09 Nov 2018 11:07:57 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=uzfgwJ7F; 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 S1728962AbeKJEp3 (ORCPT + 99 others); Fri, 9 Nov 2018 23:45:29 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:43387 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728947AbeKJEp3 (ORCPT ); Fri, 9 Nov 2018 23:45:29 -0500 Received: by mail-pf1-f193.google.com with SMTP id g7-v6so1327120pfo.10 for ; Fri, 09 Nov 2018 11:03:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yn2ADpYGFJB8QoUsSxyXC9rSSLPefLmyAe8EvMBchbQ=; b=uzfgwJ7F3iERagD3R4Ktl0VEFJwr7mVJq2bEjb747G9Za4oEykPZX/UkOOxECq1URl kvi4uH56mtDvNdNp+BHy7daR0oFOs/Gmz6l/+dZeHfiklyMGatkrJN+eEOaTwGBwzz// gwSAwQEwWhfovTnzcuMkZ81pjPiIVwjp8E39mrcXj7m+hLiy2gsqvVa2SumXwWorcglD SRcX08LNyq2xMwpmtDqlo2SfbTKo0eWJODi1xvdhbZt+2aC1ubjlhLKLWrvOGsi0gC8M 1X651CeFqIWl/r1FF7qj4QBGhHEzPFSxB7PlRAZFT3HuIyrXDlDQGXDZTJdolJZ1cKxW V4ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yn2ADpYGFJB8QoUsSxyXC9rSSLPefLmyAe8EvMBchbQ=; b=JroGoRwTPtsNa686cG+ccS0sY4nK1bp1u9Kt6VmCw2XZLIG9T9EnUgO/I7G5sZe9Ft FfsWFhrS0gj/IztRpwpe+YIlBK3HT4WU1XDT42uaccfHj+PM9gbpoG7+UO/Kzz3FFtTP iijMEp2L9TTmR9pQOc8hSLMzUCsQVj6trGQHEgjV8JaiKPvBry8SOH3ZESTCyzPTbHT4 G6OvtZy3eHKeQn83kmL+NSne7+wKLYwlZngMNgmr32Em67SZz0p8ly+Mw7o0SuwR3DWA 1ama2jEcXO0U3JfveckPUq1m725Vvc2Kc21ogmiYJpf3OVWlrdEfhcG7kpyzfNwwFmGK 8K3w== X-Gm-Message-State: AGRZ1gIom6SOWANZ7QFP3crTJdhEW9dIoTB6ARlo658CBhBMDDiky1eV fxtBKYa4fyOTOnv/GNpDvHadhe/94rs= X-Received: by 2002:a62:a5b:: with SMTP id s88-v6mr10532145pfi.136.1541790215160; Fri, 09 Nov 2018 11:03:35 -0800 (PST) Received: from ?IPv6:2600:1010:b002:666:dc7a:5a83:1f2b:9078? ([2600:1010:b002:666:dc7a:5a83:1f2b:9078]) by smtp.gmail.com with ESMTPSA id l64sm5784003pge.73.2018.11.09.11.03.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 11:03:34 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [PATCH 06/13] arc: define syscall_get_arch() From: Andy Lutomirski X-Mailer: iPhone Mail (16A404) In-Reply-To: Date: Fri, 9 Nov 2018 11:03:32 -0800 Cc: "Dmitry V. Levin" , Andy Lutomirski , Paul Moore , Eric Paris , Elvira Khabirova , "linux-snps-arc@lists.infradead.org" , "linux-audit@redhat.com" , "linux-kernel@vger.kernel.org" Content-Transfer-Encoding: quoted-printable Message-Id: <6C398ED8-30BC-4483-B5CF-1EB2F2699B0D@amacapital.net> References: <20181109031605.GF21511@altlinux.org> To: Vineet Gupta Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Nov 9, 2018, at 8:50 AM, Vineet Gupta wrot= e: >=20 >> On 11/8/18 7:16 PM, Dmitry V. Levin wrote: >> 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. >>=20 >> Signed-off-by: Dmitry V. Levin >> --- >> arch/arc/include/asm/syscall.h | 6 ++++++ >> include/uapi/linux/audit.h | 1 + >> 2 files changed, 7 insertions(+) >>=20 >> diff --git a/arch/arc/include/asm/syscall.h b/arch/arc/include/asm/syscal= l.h >> index 29de09804306..5662778a7411 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 >>=20 >> +#include >> #include >> #include >> #include >> @@ -68,4 +69,9 @@ syscall_get_arguments(struct task_struct *task, struct p= t_regs *regs, >> } >> } >>=20 >> +static inline int syscall_get_arch(void) >> +{ >> + return AUDIT_ARCH_ARC; >> +} >> + >=20 > Does ptrace (or user of this API) need a unique value per arch. Otherwise i= nstead > of adding the boilerplate code to all arches, they could simply define AUD= IT_ARCH > and common code could return it. Also the EM_xxx are not there in > include/uapi/linux/elf.h to begin with since libc elf.h already defines th= em. A lot of architectures allow multiple audit_arches at runtime due to compat s= upport and similar features, so it really does want to be a function. The g= oal of this patch set is to get it supported everywhere. >> #endif >> diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h >> index 818ae690ab79..a7149ceb5b98 100644 >> --- a/include/uapi/linux/audit.h >> +++ b/include/uapi/linux/audit.h >> @@ -375,6 +375,7 @@ enum { >>=20 >> #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_ARC (EM_ARC) >> #define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE) >> #define AUDIT_ARCH_ARMEB (EM_ARM) >> #define AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE) >=20 > So I don't have the context of this patch (or coverletter) but what exactl= y are we > trying to do with this (adding LE to audit) - what happens when an arch i= s > capable of either and is say built for BE ? The primary intent is that the triple (audit_arch, syscall_nr, arg1, ..., ar= g6) should describe what system call is being called and what its arguments a= re. I=E2=80=99m personally not sure what, if any, technical value there is i= n the LE bit. I do think it makes sense for BE and LE to have different values.=