Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

xnox opened this issue Jun 10, 2016 · 2 comments

Comments

@xnox
Copy link

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
…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 <[email protected]>
@xnox
Copy link
Author

xnox commented Jun 10, 2016

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

@xnox
Copy link
Author

xnox commented Jun 10, 2016

silly me

# scmp_sys_resolver -- -113
shutdown

@xnox xnox closed this as completed Jun 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant