[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87wnz1to9n.fsf@mpe.ellerman.id.au>
Date: Wed, 04 Nov 2020 21:22:28 +1100
From: Michael Ellerman <mpe@...erman.id.au>
To: YiFei Zhu <zhuyifei1999@...il.com>,
containers@...ts.linux-foundation.org
Cc: linux-sh@...r.kernel.org, Tobin Feldman-Fitzthum <tobin@....com>,
Hubertus Franke <frankeh@...ibm.com>,
Jack Chen <jianyan2@...inois.edu>,
linux-riscv@...ts.infradead.org,
Andrea Arcangeli <aarcange@...hat.com>,
linux-s390@...r.kernel.org, YiFei Zhu <yifeifz2@...inois.edu>,
linux-csky@...r.kernel.org, Tianyin Xu <tyxu@...inois.edu>,
linux-xtensa@...ux-xtensa.org, Kees Cook <keescook@...omium.org>,
Jann Horn <jannh@...gle.com>,
Valentin Rothberg <vrothber@...hat.com>,
Aleksa Sarai <cyphar@...har.com>,
Josep Torrellas <torrella@...inois.edu>,
Will Drewry <wad@...omium.org>, linux-parisc@...r.kernel.org,
linux-kernel@...r.kernel.org,
Andy Lutomirski <luto@...capital.net>,
Dimitrios Skarlatos <dskarlat@...cmu.edu>,
David Laight <David.Laight@...lab.com>,
Giuseppe Scrivano <gscrivan@...hat.com>,
linuxppc-dev@...ts.ozlabs.org, Tycho Andersen <tycho@...ho.pizza>
Subject: Re: [PATCH seccomp 3/8] powerpc: Enable seccomp architecture tracking
YiFei Zhu <zhuyifei1999@...il.com> writes:
> From: YiFei Zhu <yifeifz2@...inois.edu>
>
> To enable seccomp constant action bitmaps, we need to have a static
> mapping to the audit architecture and system call table size. Add these
> for powerpc.
>
> Signed-off-by: YiFei Zhu <yifeifz2@...inois.edu>
> ---
> arch/powerpc/include/asm/seccomp.h | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/arch/powerpc/include/asm/seccomp.h b/arch/powerpc/include/asm/seccomp.h
> index 51209f6071c5..3efcc83e9cc6 100644
> --- a/arch/powerpc/include/asm/seccomp.h
> +++ b/arch/powerpc/include/asm/seccomp.h
> @@ -8,4 +8,25 @@
>
> #include <asm-generic/seccomp.h>
>
> +#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.
> +#define __SECCOMP_ARCH_LE_BIT __AUDIT_ARCH_LE
> +#else
> +#define __SECCOMP_ARCH_LE_BIT 0
> +#endif
> +
> +#ifdef CONFIG_PPC64
> +# 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 ?
> +# define SECCOMP_ARCH_NATIVE_NR NR_syscalls
> +# define SECCOMP_ARCH_NATIVE_NAME "ppc64"
What's the name used for?
Usually we use "ppc64" for 64-bit big endian and "ppc64le" for 64-bit
little endian.
> +# ifdef CONFIG_COMPAT
> +# define SECCOMP_ARCH_COMPAT (AUDIT_ARCH_PPC | __SECCOMP_ARCH_LE)
> +# define SECCOMP_ARCH_COMPAT_NR NR_syscalls
> +# define SECCOMP_ARCH_COMPAT_NAME "powerpc"
And usually we use "ppc" for 32-bit.
> +# endif
> +#else /* !CONFIG_PPC64 */
> +# define SECCOMP_ARCH_NATIVE (AUDIT_ARCH_PPC | __SECCOMP_ARCH_LE)
> +# define SECCOMP_ARCH_NATIVE_NR NR_syscalls
> +# define SECCOMP_ARCH_NATIVE_NAME "powerpc"
> +#endif
> +
> #endif /* _ASM_POWERPC_SECCOMP_H */
> --
> 2.29.2
cheers
Powered by blists - more mailing lists