Summary: | >=sys-apps/sandbox-2.30-r1 on musl with <linux-5.8 - sandbox:main could not open the sandbox rc file: /usr/share/sandbox/sandbox.bashrc: Invalid argument | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | tt_1 <herrtimson> |
Component: | Current packages | Assignee: | Sandbox Maintainers <sandbox> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | marcus, sam |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://github.com/gentoo/sandbox/pull/7 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 908565 | ||
Attachments: |
output from emerge --info
output of strace -f sandbox uptime |
Description
tt_1
2023-06-18 12:11:43 UTC
Created attachment 864141 [details]
output from emerge --info
also all tests are failing
I can't reproduce this on amd64 + musl. I'll check it on arm now. (In reply to Sam James from comment #2) > I can't reproduce this on amd64 + musl. I'll check it on arm now. Can't reproduce. Please include the full 'strace -f' output of a failing command (full emerge if necessary, but try e.g. 'strace -f sandbox uptime' first). Created attachment 864160 [details] output of strace -f sandbox uptime something is missing: faccessat2(AT_FDCWD, "/var/log/sandbox/sandbox-23890.log", F_OK, AT_SYMLINK_NOFOLLOW) = -1 ENOSYS (Function not implemented) check libsandbox/pre_check_openat.c, it was added there with sandbox-2.30: https://gitweb.gentoo.org/proj/sandbox.git/tree/libsandbox/pre_check_openat.c#n22 faccessat2 was added in Linux 5.8. You appear to be running Linux 4.19.x. The issue was probably introduced here: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=f63fea69097e37424c700f820d25591747a15752 *** Bug 908766 has been marked as a duplicate of this bug. *** The behavior on musl seems to be different from glibc.
On glibc, if faccessat2 fails with ENOSYS, it calls fstatat (or newfstatat on amd64) as a fallback.
> faccessat2(AT_FDCWD, "/dev/null", F_OK, AT_SYMLINK_NOFOLLOW) = -1 ENOSYS (Function not implemented)
> newfstatat(AT_FDCWD, "/dev/null", {st_mode=S_IFCHR|0666, st_rdev=makedev(0x1, 0x3), ...}, AT_SYMLINK_NOFOLLOW) = 0
musl bug report: https://www.openwall.com/lists/musl/2023/06/19/1 The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=b55840ebe3278032777a3b52cecc6dac325dcf85 commit b55840ebe3278032777a3b52cecc6dac325dcf85 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2023-06-19 15:50:46 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2023-06-21 14:40:08 +0000 libsbutil: add sb_exists function This provides a central place to work around a bug on musl where faccessat sets errno to EINVAL when the kernel does not support faccessat2. Bug: https://bugs.gentoo.org/908765 Signed-off-by: Mike Gilbert <floppym@gentoo.org> libsandbox/pre_check_openat.c | 2 +- libsandbox/wrapper-funcs/fopen_pre_check.c | 2 +- libsbutil/local.mk | 1 + libsbutil/sb_exists.c | 24 ++++++++++++++++++++++++ libsbutil/sbutil.h | 1 + libsbutil/src/file.c | 2 +- 6 files changed, 29 insertions(+), 3 deletions(-) The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1581bf33d00a80115a4f78bcb292faccc962a700 commit 1581bf33d00a80115a4f78bcb292faccc962a700 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2023-06-21 14:54:13 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2023-06-21 14:55:16 +0000 sys-apps/sandbox: add 2.32 Closes: https://bugs.gentoo.org/908765 Signed-off-by: Mike Gilbert <floppym@gentoo.org> sys-apps/sandbox/Manifest | 1 + sys-apps/sandbox/sandbox-2.32.ebuild | 64 ++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) |