Re: [PATCH v13 0/3] Add kernel seccomp support for m68k

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Adrian,


Am 14.01.2023 um 06:29 schrieb John Paul Adrian Glaubitz:
Hi!

On 1/12/23 04:55, Michael Schmitz wrote:
Previous version of patch 1 did overwrite a syscall return
value that was changed by ptrace or seccomp (in regs->d0)
by -ENOSYS when skipping a syscall. Branch directly to
ret_from_syscall instead of falling through to badsys (which
must set -ENOSYS). I'm sure this can be done more elegantly.

Patch 3 used the wrong struct definition for ARCH_REGS - the
kernel ptrace code copies 19 registers (from syscall stack
and switch_stack, pt_regs only contains the 14 from the
syscall stack). Stack overflow ensues.

With these changes, 79 of 94 seccomp_bpf tests now succeed.

I have also opened a PR now to add m68k support to libseccomp [1].

Unfortunately, libseccomp fails to build after I updated the
syscalls.csv file
after adding m68k support. It seems that the problem are a number of
syscalls
that exist on m68k only:

  CC       libseccomp_la-syscalls.perf.lo
syscalls.perf:152:70: error: '__PNR_getpagesize' undeclared here (not in
a function)
  152 |
getpagesize,119,__PNR_getpagesize,SCMP_KV_UNDEF,__PNR_getpagesize,SCMP_KV_UNDEF,__PNR_getpagesize,SCMP_KV_UNDEF,__PNR_getpagesize,SCMP_KV_UNDEF,__PNR_getpagesize,SCMP_KV_UNDEF,166,SCMP_KV_UNDEF,__PNR_getpagesize,SCMP_KV_UNDEF,__PNR_getpagesize,SCMP_KV_UNDEF,__PNR_getpagesize,SCMP_KV_UNDEF,__PNR_getpagesize,SCMP_KV_UNDEF,__PNR_getpagesize,SCMP_KV_UNDEF,__PNR_getpagesize,SCMP_KV_UNDEF,__PNR_getpagesize,SCMP_KV_UNDEF,__PNR_getpagesize,SCMP_KV_UNDEF,__PNR_getpagesize,SCMP_KV_UNDEF,__PNR_getpagesize,SCMP_KV_UNDEF,__PNR_getpagesize,SCMP_KV_UNDEF

That one also exists on alpha and sparc. The other two are indeed unique to m68k.

There must have been other cases of novel syscalls added to libseccomp before?

Cheers,

	Michael


|
^~~~~~~~~~~~~~~~~~~~
make[3]: *** [Makefile:903: libseccomp_la-syscalls.perf.lo] Error 1
make[2]: *** [Makefile:922: all-recursive] Error 1
make[1]: *** [Makefile:524: all-recursive] Error 1
make: *** [Makefile:433: all] Error 2

Adrian

[1] https://github.com/seccomp/libseccomp/pull/397




[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux