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

BUG: add support for the faccessat2() syscall #314

Closed
trofi opened this issue Feb 3, 2021 · 5 comments · Fixed by #322
Closed

BUG: add support for the faccessat2() syscall #314

trofi opened this issue Feb 3, 2021 · 5 comments · Fixed by #322

Comments

@trofi
Copy link

trofi commented Feb 3, 2021

In pax-utils (libseccomp user) we recently discovered that glibc-2.33 started using faccessat2 syscall: https://bugs.gentoo.org/768435

Would it be reasonable to add it to list of known syscalls it seccomp-syscalls.h?

Thanks!

@pcmoore pcmoore changed the title Add faccessat2 syscall to seccomp-syscalls.h BUG: add support for the faccessat2() syscall Feb 3, 2021
@pcmoore
Copy link
Member

pcmoore commented Feb 3, 2021

Hi @trofi, what version of libseccomp are you using? I ask because the faccessat2() syscall has been defined in libseccomp since v2.5.0; if you are using an older version of libseccomp you are strongly encouraged to upgrade to the latest v2.5.x release (currently that is v2.5.1).

Here is a the definition in the v2.5.0 release tag (HINT: the syscalls.csv file is searchable in GitHub):

@trofi
Copy link
Author

trofi commented Feb 4, 2021

Oh, interesting. I'm using release 2.5.1, but my /usr/include/seccomp-syscalls.h doe not seem to have needed syscalls available for use with SCMP_SYS(faccessat2) macro:

$ cat a.c
#include <seccomp.h>

int base_syscalls[] = {
    SCMP_SYS(faccessat),  // ok
    SCMP_SYS(faccessat2), // fails
};
$ gcc -c a.c
In file included from a.c:1:
a.c:5:5: error: '__SNR_faccessat2' undeclared here (not in a function)
    5 |     SCMP_SYS(faccessat2), // fails
      |     ^~~~~~~~
$ fgrep faccess /usr/include/seccomp-syscalls.h
#define __SNR_faccessat                 __NR_faccessat

Could it be that release tarball (and git tree) contains pregenerated list of syscalls from that file that was not updated after csv change?

@drakenclimber
Copy link
Member

Good find. Looks like we're missing the appropriate #defines for faccessat2 in seccomp-syscalls.h

@pcmoore
Copy link
Member

pcmoore commented Feb 4, 2021

Ha, yes, it looks like you guys are right! I went ahead and added this to the v2.5.2 milestone so it should be in the next v2.5.x maintenance release.

I also created issue #315 to have the src/arch-syscall-check.c test for this so hopefully we can catch these during development in the future.

pevik added a commit to pevik/ltp that referenced this issue Feb 17, 2021
Tumbleweed uses glibc 2.33, which introduced incompatibility
(uses faccessat2) [1], which requires libseccomp v2.5.0.
The newest Ubuntu in Travis (actually any Ubuntu) has 2.4.3,
thus temporarily remove openSUSE Tumbleweed.

[1] seccomp/libseccomp#314

Signed-off-by: Petr Vorel <[email protected]>
pevik added a commit to linux-test-project/ltp that referenced this issue Feb 17, 2021
Tumbleweed uses glibc 2.33, which introduced incompatibility
(uses faccessat2) [1], which requires libseccomp v2.5.0.
The newest Ubuntu in Travis (actually any Ubuntu) has 2.4.3,
thus temporarily remove openSUSE Tumbleweed.

[1] seccomp/libseccomp#314

Signed-off-by: Petr Vorel <[email protected]>
pevik added a commit to iputils/iputils that referenced this issue Feb 22, 2021
Tumbleweed uses glibc 2.33, which introduced incompatibility
(uses faccessat2) [1], which requires libseccomp v2.5.0.
The newest Ubuntu in Travis (actually any Ubuntu) has 2.4.3,
thus temporarily remove openSUSE Tumbleweed.

[1] seccomp/libseccomp#314

Signed-off-by: Petr Vorel <[email protected]>
@pcmoore pcmoore linked a pull request Apr 17, 2021 that will close this issue
@pcmoore
Copy link
Member

pcmoore commented Apr 28, 2021

This should be resolve with PR #322 so I'm going to close this out; the fix will be in the next v2.5.x release.

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

Successfully merging a pull request may close this issue.

3 participants