strange behaviour on v4.4 kernels with libseccomp v2.3.1 #40

Closed
xnox opened this Issue Jun 10, 2016 · 2 comments

Comments

Projects
None yet
1 participant

xnox commented Jun 10, 2016

Hello,

I'm in a i686 chroot, and using scmp_sys_resolver I see multiple regression with syscall look-ups. The tests I run is to check that number->name->number lookups are roundtrip safe, and they appear to not be as per below:

# ./scmp_sys_resolver 373
shutdown
# ./scmp_sys_resolver shutdown
-113
# ./scmp_sys_resolver '\-113'
-1
# ./scmp_sys_resolver -t shutdown
102
# ./scmp_sys_resolver 102
socketcall

My expectation was for the output to just be:

# ./scmp_sys_resolver 373
shutdown
# ./scmp_sys_resolver shutdown
373

I see this regression for other syscalls too, on i686 and on s390x architectures.
amd64 and ppc64el pass correctly.

s390x failures:

FAIL: 357 (recvmmsg) != recvmmsg (-119)
FAIL: 358 (sendmmsg) != sendmmsg (-120)
FAIL: 359 (socket) != socket (-101)
FAIL: 360 (socketpair) != socketpair (-108)
FAIL: 361 (bind) != bind (-102)
FAIL: 362 (connect) != connect (-103)
FAIL: 363 (listen) != listen (-104)
FAIL: 364 (accept4) != accept4 (-118)
FAIL: 365 (getsockopt) != getsockopt (-115)
FAIL: 366 (setsockopt) != setsockopt (-114)
FAIL: 367 (getsockname) != getsockname (-106)
FAIL: 368 (getpeername) != getpeername (-107)
FAIL: 369 (sendto) != sendto (-111)
FAIL: 370 (sendmsg) != sendmsg (-116)
FAIL: 371 (recvfrom) != recvfrom (-112)
FAIL: 372 (recvmsg) != recvmsg (-117)
FAIL: 373 (shutdown) != shutdown (-113)

i686 failures:

FAIL: 337 (recvmmsg) != recvmmsg (-119)
FAIL: 345 (sendmmsg) != sendmmsg (-120)
FAIL: 359 (socket) != socket (-101)
FAIL: 360 (socketpair) != socketpair (-108)
FAIL: 361 (bind) != bind (-102)
FAIL: 362 (connect) != connect (-103)
FAIL: 363 (listen) != listen (-104)
FAIL: 364 (accept4) != accept4 (-118)
FAIL: 365 (getsockopt) != getsockopt (-115)
FAIL: 366 (setsockopt) != setsockopt (-114)
FAIL: 367 (getsockname) != getsockname (-106)
FAIL: 368 (getpeername) != getpeername (-107)
FAIL: 369 (sendto) != sendto (-111)
FAIL: 370 (sendmsg) != sendmsg (-116)
FAIL: 371 (recvfrom) != recvfrom (-112)
FAIL: 372 (recvmsg) != recvmsg (-117)
FAIL: 373 (shutdown) != shutdown (-113)

Are my expectation somehow wrong? is v4.5 kernel required for v2.3.1 release? Is there a bug in compat between kernel versions?

xnox added a commit to xnox/libseccomp that referenced this issue Jun 10, 2016

Drop table overrides in x86_syscall_resolve_name() to pseudo syscall …
…numbers

A bunch of syscalls got converted from pseudo to real syscall
numbers. And the table now corectly uses pseudo syscall numbers where
needed (e.g. accept, send) thus there is no need to repeat these
overrides in the x86_syscall_resolve_name() which has now got out of
sync with the table.

Fixes seccomp#40

Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>

xnox commented Jun 10, 2016

Actually this is maybe a non-bug, given 73d83e4

xnox commented Jun 10, 2016

silly me

# scmp_sys_resolver -- -113
shutdown

@xnox xnox closed this Jun 10, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment