Received: by 2002:aa6:c46f:0:b029:96:faae:e639 with SMTP id i15csp326552lkq; Thu, 5 Nov 2020 03:35:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwMFFeV/hwf4moxChmVDRMJ5q3GjR7TO3EosaE6oKN+Q/NqhJuUzSwwXmETfnD7W2DJy5+w X-Received: by 2002:a17:906:6702:: with SMTP id a2mr1752452ejp.309.1604576129109; Thu, 05 Nov 2020 03:35:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604576129; cv=none; d=google.com; s=arc-20160816; b=Rb4ZVLiVpfu0ZYYXblughv5J2emNTXyBrAl1PwJ448T8XwBxSM5mf/IIHLxeyAE4HN NblSQhzcS5nHcd5D4oUYIHtYwX7vvhKPoNVxAr4dJclpT3jDUQF6BnLMmVshpb7aKivs wbHBMZXzowCSecXJjy1LHFL3Dw113c1zWWOgEM04nn9JuNWmL/oN6PJBc9M2GAD3/qPk DSnLOf0tR8Ip48heOuMmpzZN1u3tEk6nEgrMCBiuVfENncpZLBVrupLDm289eFmM+PDb B0NpAEGmShgZKTFPaT04vcI4L6WuMTJ5/X+7OGfxeBvckl+6e3+g4WYJgpUsM0MsxA8H ZimA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=X/dLjl+6wXNhzBw2Ei4UCKtHIVP1bYOBo3rYPf9KdsM=; b=EuUrOEyUXxmBBpuEeOw6EL6L7psTPg/TcPe3e3uD+LNijWQrBaBUg6WDwlTxqBg37Y 7Hh9jbNUIXkhUJcCNRYolXMSa3EmXJ4wa8N6OXK1v/BuC3zpesT2KtoLlUPZwZoBh7Oh nHd7+jhJf151XVzBcoJnLU8sp0CI+9lDhWUffj/ax+cdL8/pnolTowc6Z95glhTxxKXe mQabTNgbu+zctM2exIh3GXJXc9zkqqTMhDdCuZXqQTODerkgDKuM87H60Lo1uJnvkfea mlojqQaQzqgs3VrIhMUPo5cWejG8bp9UFe1oJCwXNolPX3ttjiqd8U9ag3BL+k5eIfMI 2khw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=EuqJG+oW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si875652eda.182.2020.11.05.03.35.04; Thu, 05 Nov 2020 03:35:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=EuqJG+oW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730186AbgKEL0v (ORCPT + 99 others); Thu, 5 Nov 2020 06:26:51 -0500 Received: from bilbo.ozlabs.org ([203.11.71.1]:40529 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726777AbgKEL0v (ORCPT ); Thu, 5 Nov 2020 06:26:51 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4CRh7927Qnz9sVS; Thu, 5 Nov 2020 22:26:45 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1604575608; bh=N3LQMBxz53FTAnoaW8tqbR9RuS1nFNL/IBcDzTEmo04=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=EuqJG+oW9YMlU/9C7w+LY7w/BEHnurdsiXw5EYLeUouxUmPtg9DLXMDz6koBzkxFP /0Tdhcy4LzU97SCf0ag1B9XfPPfCzdauwZdXGomHJaB/s4VOtaFYmryYlWheiAwxAJ p8ydnxllcULes9/vYcWWndvJDvPUHHyKjqOJu4D4txoq8JMyMyAYRkm2ASAbiHYP/r GEtXi5DM2CcI3+gnulMIrGgHvItowZwos2kYpEtDoZEq4gCyyvNWlgTXF8G8V9vkaZ hRWv8Cs33o7XpzNAIdrgVm40jwWUQSU2QFGO1+x3JhRd8lyIbpOhMPgjlpYFqdu77L khu7frJN8nxJg== From: Michael Ellerman To: YiFei Zhu Cc: Linux Containers , linux-sh@vger.kernel.org, Tobin Feldman-Fitzthum , Hubertus Franke , Jack Chen , linux-riscv@lists.infradead.org, Andrea Arcangeli , linux-s390@vger.kernel.org, YiFei Zhu , linux-csky@vger.kernel.org, Tianyin Xu , linux-xtensa@linux-xtensa.org, Kees Cook , Jann Horn , Valentin Rothberg , Aleksa Sarai , Josep Torrellas , Will Drewry , linux-parisc@vger.kernel.org, kernel list , Andy Lutomirski , Dimitrios Skarlatos , David Laight , Giuseppe Scrivano , linuxppc-dev@lists.ozlabs.org, Tycho Andersen Subject: Re: [PATCH seccomp 3/8] powerpc: Enable seccomp architecture tracking In-Reply-To: References: <4ec2970fcc819eb4d5dac2bd35233ccdadfda845.1604410035.git.yifeifz2@illinois.edu> <87wnz1to9n.fsf@mpe.ellerman.id.au> Date: Thu, 05 Nov 2020 22:26:44 +1100 Message-ID: <87ft5ot56z.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org YiFei Zhu writes: > On Wed, Nov 4, 2020 at 4:22 AM Michael Ellerman wrote: >> > +#ifdef __LITTLE_ENDIAN__ >> >> As Kees mentioned this should (must?!) match the configured endian. >> >> But I think it would still be better to use the CONFIG symbol, which is >> CONFIG_CPU_LITTLE_ENDIAN. > > My attempt here is to be consistent with asm/syscall.h > syscall_get_arch [1]. Would it make sense to change that to > CONFIG_CPU_LITTLE_ENDIAN then? > > [1] https://elixir.bootlin.com/linux/latest/source/arch/powerpc/include/asm/syscall.h#L116 Looking across the tree with have thousands of usages of __LITTLE_ENDIAN__, so it's probably not worth converting to CONFIG_CPU_LITTLE_ENDIAN. >> > +# define SECCOMP_ARCH_NATIVE (AUDIT_ARCH_PPC64 | __SECCOMP_ARCH_LE) >> >> You use __SECCOMP_ARCH_LE there, but previously you only defined >> __SECCOMP_ARCH_LE_BIT. >> >> Is there some magic somewhere that defines __SECCOMP_ARCH_LE based on >> __SECCOMP_ARCH_LE_BIT ? > > Oops, my bad here. OK :) >> > +# define SECCOMP_ARCH_NATIVE_NR NR_syscalls >> > +# define SECCOMP_ARCH_NATIVE_NAME "ppc64" >> >> What's the name used for? > > This is used in the last patch in this series to report in procfs the > name of each architecture tracked by the bitmap cache. OK, yeah I think it would be better if the matched the uname -m values. >> Usually we use "ppc64" for 64-bit big endian and "ppc64le" for 64-bit >> little endian. >> >> And usually we use "ppc" for 32-bit. > > Ok. cheers