Re: [PATCH 3/4] sh: Add SECCOMP_FILTER

2020-09-03 Thread Rich Felker
On Thu, Sep 03, 2020 at 08:04:44AM +0200, John Paul Adrian Glaubitz wrote: > On 9/3/20 7:46 AM, Rich Felker wrote: > > > > OK, I think I have an explanation for the mechanism of the bug, and it > > really is a combination of the 2008 bug (confusion of r0 vs r3) and > > the SECCOMP_FILTER commit.

Re: [PATCH 3/4] sh: Add SECCOMP_FILTER

2020-09-03 Thread John Paul Adrian Glaubitz
On 9/3/20 7:46 AM, Rich Felker wrote: > > OK, I think I have an explanation for the mechanism of the bug, and it > really is a combination of the 2008 bug (confusion of r0 vs r3) and > the SECCOMP_FILTER commit. When the syscall_trace_entry code path is > in use, a syscall with argument 5 having

Re: [PATCH 3/4] sh: Add SECCOMP_FILTER

2020-09-03 Thread John Paul Adrian Glaubitz
Hi Richi! On 9/3/20 5:56 AM, Rich Felker wrote: >> Test 51-live-user_notification%%001-1 result: FAILURE >> 51-live-user_notification 5 ALLOW rc=14 > > AFAICT, this test is buggy and cannot possibly work. It attempts to > have SYS_getpid return a 64-bit value and check that the returned >

Re: [PATCH 3/4] sh: Add SECCOMP_FILTER

2020-09-02 Thread Rich Felker
On Wed, Sep 02, 2020 at 11:56:04PM -0400, Rich Felker wrote: > On Sat, Aug 29, 2020 at 01:09:43PM +0200, John Paul Adrian Glaubitz wrote: > > Hi! > > > > On 8/29/20 2:49 AM, Rich Felker wrote: > > > This restored my ability to use strace > > > > I can confirm that. However ... > > > > > and

Re: [PATCH 3/4] sh: Add SECCOMP_FILTER

2020-09-02 Thread Rich Felker
On Sat, Aug 29, 2020 at 01:09:43PM +0200, John Paul Adrian Glaubitz wrote: > Hi! > > On 8/29/20 2:49 AM, Rich Felker wrote: > > This restored my ability to use strace > > I can confirm that. However ... > > > and I've written and tested a minimal strace-like hack using > >

Re: [PATCH 3/4] sh: Add SECCOMP_FILTER

2020-08-29 Thread John Paul Adrian Glaubitz
Hi! On 8/29/20 2:49 AM, Rich Felker wrote: > This restored my ability to use strace I can confirm that. However ... > and I've written and tested a minimal strace-like hack using > SECCOMP_RET_USER_NOTIF that works as > expected on both j2 and qemu-system-sh4, so I think the above is > correct.

Re: [PATCH 3/4] sh: Add SECCOMP_FILTER

2020-08-28 Thread Rich Felker
On Fri, Aug 28, 2020 at 01:03:00PM -0400, Rich Felker wrote: > On Fri, Aug 28, 2020 at 06:38:09PM +0200, John Paul Adrian Glaubitz wrote: > > Hi! > > > > On 8/28/20 6:30 PM, Rich Felker wrote: > > > I'm about to test a patch along these lines and will report what I > > > find. > > > > Let me

Re: [PATCH 3/4] sh: Add SECCOMP_FILTER

2020-08-28 Thread Rich Felker
On Fri, Aug 28, 2020 at 06:38:09PM +0200, John Paul Adrian Glaubitz wrote: > Hi! > > On 8/28/20 6:30 PM, Rich Felker wrote: > > I'm about to test a patch along these lines and will report what I > > find. > > Let me know when you have something to test and I will test the patch as > well, making

Re: [PATCH 3/4] sh: Add SECCOMP_FILTER

2020-08-28 Thread John Paul Adrian Glaubitz
Hi! On 8/28/20 6:30 PM, Rich Felker wrote: > I'm about to test a patch along these lines and will report what I > find. Let me know when you have something to test and I will test the patch as well, making sure we're not breaking seccomp again. Adrian -- .''`. John Paul Adrian Glaubitz : :'

Re: [PATCH 3/4] sh: Add SECCOMP_FILTER

2020-08-28 Thread Rich Felker
On Fri, Aug 28, 2020 at 11:50:25AM -0400, Rich Felker wrote: > On Thu, Jul 23, 2020 at 01:13:21AM +0200, Michael Karcher wrote: > > Port sh to use the new SECCOMP_FILTER code. > > > > Signed-off-by: Michael Karcher > > --- > > arch/sh/Kconfig | 1 + > >

Re: [PATCH 3/4] sh: Add SECCOMP_FILTER

2020-08-28 Thread John Paul Adrian Glaubitz
On 8/28/20 5:50 PM, Rich Felker wrote: > This patch broke strace - it spews out bogus syscalls and gets the > tracee hung. I suspect the last hunk is wrong and breaks all > non-seccomp tracing. I'll follow up with further analysis and possibly > a fix if you don't find one sooner. Hmm, it does not

Re: [PATCH 3/4] sh: Add SECCOMP_FILTER

2020-08-28 Thread Rich Felker
On Thu, Jul 23, 2020 at 01:13:21AM +0200, Michael Karcher wrote: > Port sh to use the new SECCOMP_FILTER code. > > Signed-off-by: Michael Karcher > --- > arch/sh/Kconfig | 1 + > arch/sh/kernel/entry-common.S | 2 ++ > arch/sh/kernel/ptrace_32.c

[PATCH 3/4] sh: Add SECCOMP_FILTER

2020-07-22 Thread Michael Karcher
Port sh to use the new SECCOMP_FILTER code. Signed-off-by: Michael Karcher --- arch/sh/Kconfig | 1 + arch/sh/kernel/entry-common.S | 2 ++ arch/sh/kernel/ptrace_32.c| 5 +++-- tools/testing/selftests/seccomp/seccomp_bpf.c | 8

Re: [PATCH 3/4] sh: Add SECCOMP_FILTER

2020-07-22 Thread John Paul Adrian Glaubitz
On 7/23/20 1:13 AM, Michael Karcher wrote: > Port sh to use the new SECCOMP_FILTER code. > > Signed-off-by: Michael Karcher > --- > arch/sh/Kconfig | 1 + > arch/sh/kernel/entry-common.S | 2 ++ > arch/sh/kernel/ptrace_32.c| 5