From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755866AbbIIVUb (ORCPT ); Wed, 9 Sep 2015 17:20:31 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:58405 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755163AbbIIVU1 (ORCPT ); Wed, 9 Sep 2015 17:20:27 -0400 From: Arnd Bergmann To: Kees Cook Cc: "linux-arm-kernel@lists.infradead.org" , Will Drewry , Linux API , Shuah Khan , Andy Lutomirski , Bamvor Zhang Jian , LKML Subject: Re: [PATCH] selftests/seccomp: build on aarch64, document ABI Date: Wed, 09 Sep 2015 23:20:18 +0200 Message-ID: <480615028.m9oKCRv0Vd@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <20150909193025.GA29244@www.outflux.net> <19228212.s6UOoYJca9@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:zM8Va+iL5tWsCAuyik/iHUYZgRyxg9EwaZknzbzI//dIXVMmqey 8luP9YvV3qrWnBrcdsksDdZLuzRiUZqMpbz90WZtXx37Hj/rcovmd99TupgZVZ0sF0FK7SD tiKK3zCCDs2YRP1isiP4gmUKMGrsjtEp4M1qfQS1ItbB6uboEezRX3AZBTFBs5VM7dxceFI AdRTnkYasteYyeiqRRj1Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:Z/O0sCnO/ic=:FuvL1rbev7EZyyJzqqUdJi IrbdA9jb0ezf/DHNbSsHtVvvf5kw5S0RWK8sli5zmjOhda64L9uvxnv2r1+KPr8bwQJoInIUE iIoEcg/5pA0FuEdvCYmKvJ+f8zyewAUkTWnl5zXJqkZ8NKgoSVk+b6To0rEY3HCLJrkZXKt45 r6NmJj92AgkUT1cfJb63g9TEPFSw7ixjQAheJsbmq+XUR283OBVe/k0mnzeDVWpOFsyq55HXa XyAkDC6UMo0gPX0Okj9tiNpSch1b+CDhtPzDuApfrO0YU59o4YlwZyxFzqTdwpwxk2cloEFuo BDBPL9X/J+ii8+RX9S35lZ558hGHve6e8k3Z3eVsrR1DCrq57+IKCOlgHClg/B1x5Qr0gSWgL qVptT+2K6lxj+/rRJHjv3JOOvUBEpw5+0tCofwlfNipLD4Uq1HFVwmFiSHE+ncJN7+KOw+ghq Jvd3cfU+9En1Od6Nuv9g1F8c8i5JZfqeRTLSmdKcqcR9nB3E741oPsdFcMPb3s6JLVDCmJgP0 OmHvTqRfCmTPqW6S4YQRUUv7jl4ilcbz6fXlksk+eqP7hkIl3bz6vYSS1B4PFWwJbKrWtH6PT n6Ly3IOgXRxakGlXOTV3XWh37rKQx3C82SVapU6IshjqVR9BiCBfFDDZes1XoR+yL3G96okve tX9pU0V12bUSy8RfP0Rab48lVTh1JzIFERvPPVKLI7YpBteP4SuW3UqzClu3goSfCpHS1djb4 5dQZzz76w/bFJixB Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 09 September 2015 13:52:39 Kees Cook wrote: > On Wed, Sep 9, 2015 at 1:08 PM, Arnd Bergmann wrote: > > On Wednesday 09 September 2015 12:30:27 Kees Cook wrote: > > 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. > > Does ppoll still get interrupted like poll to require a restart_syscall call? Yes, the only difference between the two is the optional signal mask argument in ppoll. > Regardless, the primary problem is this (emphasis added): > > >> + * - native ARM does _not_ expose true syscall. > >> + * - compat ARM on ARM64 _does_ expose true syscall. > > When you ptrace or seccomp an arm32 binary under and arm32 kernel, > restart_syscall is invisible. When you ptrace or seccomp an arm32 > binary under and arm64 kernel, suddenly it's visible. This means, for > example, seccomp filters will break under an arm64 kernel. Ok, I see. > (And apologies if I'm not remembering pieces of this correctly, I > don't have access to arm64 hardware at the moment, which is why I'm > reaching out for some help on this... I'm trying to close out this old > thread: https://lkml.org/lkml/2015/1/20/778 ) FWIW, it should not be too hard to get an image that runs in qemu-system-arm64. I suppose the same problem exists on all restartable system calls (e.g. nanosleep, select, recvmsg, clock_nanosleep, ...)? I also believe there are various architectures that cannot see the original system call number for a restarted syscall, in particular when the syscall number argument is in the same register as the return code of the syscall and gets overwritten on the way out of the kernel. Is this the problem you are seeing? If so, we should find a solution that works on all such architectures. Arnd