From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754432AbbIIUI4 (ORCPT ); Wed, 9 Sep 2015 16:08:56 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:60266 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752066AbbIIUIx (ORCPT ); Wed, 9 Sep 2015 16:08:53 -0400 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Kees Cook , Will Drewry , linux-api@vger.kernel.org, Shuah Khan , Andy Lutomirski , Bamvor Zhang Jian , linux-kernel@vger.kernel.org Subject: Re: [PATCH] selftests/seccomp: build on aarch64, document ABI Date: Wed, 09 Sep 2015 22:08:17 +0200 Message-ID: <19228212.s6UOoYJca9@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20150909193025.GA29244@www.outflux.net> References: <20150909193025.GA29244@www.outflux.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:YavoKCQGB91JQ09INQODQ2/UHK7vkzb8sCzic0ukmF3STqB4A7q 9hcqabu8M4onyxp6sKXemFzKynwNO2sbYSkaYeVkzJCVik5oZrPT9i7NXEE6VZ7dHjxvAZk C941yzKJdT63rpBZOpEKvDlovsZgfSns29lXMXjN8xtfAR1zPhMPHc8YUBEFnFxNb1Pv561 lKMs2fn/cMIJ7K+suzS+A== X-UI-Out-Filterresults: notjunk:1;V01:K0:eOqiUhTbO88=:iQznMlzdAqf0gwVEoaR0Ee iv7DeB0LuphPeuUXMwKjj9jVe5+pkSJf3iCT2IcHApK/pnyMHny0f9t/atI0u96aC7QtjgMFI k0kJVpVD5MEiGyYigX4MzK9bQT3Yc2oWk7bzYT29aiVjn6MiBs8OIp6X/a7Wz+KUxX+EjmWyv UVMKFdV0pfrViSnlZBD/TgVOGVg8ksusU2pA0+tm4rugG17hRbtd9olE+rkT/OvYfHNHZSypA lY/Fwjv/98PiOraZuixOxDp1KrMXYZbDC3svFpT9aipccKRnHDIKDGFd/c09f+zkin/6v6uSx g2llUm6ADecnXW0gWRvxiEHWI0M3oVjUQRWiN9MxBsndvfral1fyhu3iwr53A3+Xgxx8FmUkH dRNS7K0rid7uyN8yoz+GozZKDJ7+YSoUGVh84E1R3iViKYKvjXTa2S7Gz0GTvUJpu7NyklhMA I7TSHA46VujrGBVysLWLJWeH3jmz2ox8WONuNO7YMYExf236pjuLSmNizkMScJh4MShJ6RPer tBG8s2/LmHgfAVLmZR5do4Sf+ai0H185yqGJvbVu7YmBmznrFU8EBRUyowEvLVkJEOFDoJsNB 1mOID+uuk3UqGX1O+gCAXhwKlAI3+/ZRAfucqVBkzb2vBrwWc6s7m2X386YU1oXo+q5o0uGjv vQUaEbSip+XErhxCDeH3WuOEoPK/hq6w6xa+mcMQuUlX0dwDh6mWKV+PXMSAlKC6dwa1xrJZb r4qDmUcywaTM5/rD Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 09 September 2015 12:30:27 Kees Cook wrote: > The syscall ABI is inconsistent on aarch64 compat, so at least we should > document it in the seccomp_bpf tests. > > Signed-off-by: Kees Cook Can you explain in what way the ABI is inconsistent here? > --- > Can someone with access to native aarch64 double-check this for me? I > think we need to change these tests to pass if it's expected, but the > compat behavior seems bad. It means compat code will break under an > aarch64 kernel, when dealing with syscalls, like through seccomp. > --- > tools/testing/selftests/seccomp/seccomp_bpf.c | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c > index 770f47adf295..866ff42e000d 100644 > --- a/tools/testing/selftests/seccomp/seccomp_bpf.c > +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c > @@ -33,6 +33,10 @@ > #include > #include > > +#if defined(__aarch64__) && !defined(__NR_poll) > +# define __NR_poll 0x49 > +#endif I don't understand this: 0x49 is __NR_ppoll on arm64 and all architectures that use asm-generic/unistd.h, not __NR_poll, which is no longer used there. If this is intentional, it at least needs a comment to explain the situation, and be extended to all other architectures that do not have a poll() system call. The arm32 version of sys_poll should be available as 168 in both native and compat mode. Arnd