Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 914928 - sys-apps/file-5.45-r1 fails to build with USE="seccomp" and FEATURES="usersandbox" under older Kernels with musl
Summary: sys-apps/file-5.45-r1 fails to build with USE="seccomp" and FEATURES="usersan...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Sandbox Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-30 00:19 UTC by Sven E.
Modified: 2024-06-26 21:40 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,48.87 KB, text/plain)
2023-09-30 00:22 UTC, Sven E.
Details
emerge.info (emerge.info,5.37 KB, text/plain)
2023-09-30 00:29 UTC, Sven E.
Details
strace (strace,188.61 KB, application/octet-stream)
2024-02-23 10:38 UTC, Pavel
Details
file.300k.strace.xz (file.300k.strace.xz,847.35 KB, application/x-xz)
2024-06-26 20:56 UTC, Sven E.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sven E. 2023-09-30 00:19:16 UTC
Build fails with 'Bad System Call'. PRoblem ist related to sandbox and facces2() Syscall.

build.log etc. will follow.
Comment 1 Sven E. 2023-09-30 00:22:04 UTC
Created attachment 871794 [details]
build.log

build.log
Comment 2 Sven E. 2023-09-30 00:27:18 UTC
As far as I can tell, the problem ist related to faccessat2(), while in most cases there's a fallback to faccessat, this seems to fail, when it comes to sandbox:

157584 faccessat2(AT_FDCWD, "/var/tmp/portage/sys-apps/file-5.45-r1/temp/sandbox-misc.log", F_OK, AT_SYMLINK_NOFOLLOW|AT_EACCESS) = -1 ENOSYS (Function not implemented)
157584 lstat("/var/tmp/portage/sys-apps/file-5.45-r1/temp/sandbox-misc.log", 0x7ffd7c25b0c0) = -1 ENOENT (No such file or directory)
157584 access("/var/log/sandbox", W_OK) = 0
157584 getpid()                         = 157584
157584 faccessat2(AT_FDCWD, "/var/log/sandbox/sandbox-debug-157584.log", F_OK, AT_SYMLINK_NOFOLLOW|AT_EACCESS) = -1 ENOSYS (Function not implemented)
157584 lstat("/var/log/sandbox/sandbox-debug-157584.log", 0x7ffd7c25b0c0) = -1 ENOENT (No such file or directory)
157584 readlink("/proc", 0x7ffd7c25a1f0, 4088) = -1 EINVAL (Invalid argument)
157584 readlink("/proc/self", "157584", 4093) = 6
157584 readlink("/proc/157584", 0x7ffd7c25a1f0, 4093) = -1 EINVAL (Invalid argument)
157584 readlink("/proc/157584/fd", 0x7ffd7c25a1f0, 4096) = -1 EINVAL (Invalid argument)
157584 faccessat2(AT_FDCWD, "/usr/share/sandbox/sandbox.bashrc", F_OK, AT_SYMLINK_NOFOLLOW|AT_EACCESS) = -1 ENOSYS (Function not implemented)
157584 lstat("/usr/share/sandbox/sandbox.bashrc", {st_mode=S_IFREG|0644, st_size=3751, ...}) = 0
Comment 3 Sven E. 2023-09-30 00:29:25 UTC
Created attachment 871795 [details]
emerge.info

emerge info
Comment 4 Mike Gilbert gentoo-dev 2023-10-03 14:24:34 UTC
Please attach the full strace log.
Comment 5 Sven E. 2023-10-03 15:27:31 UTC
Unfortunately:

# Error: Bugzilla error: The file you are trying to attach is 5054 kilobytes (KB) in size. Attachments cannot be more than 1000 KB.

strace is already xz'd.
Comment 6 Pavel 2024-02-23 10:38:52 UTC
Created attachment 885806 [details]
strace
Comment 7 Mike Gilbert gentoo-dev 2024-02-23 15:14:14 UTC
(In reply to Pavel from comment #6)

That appears to be a different failure.
Comment 8 Philippe Michaud-Boudreault 2024-06-25 05:19:44 UTC
Seccomp failed under glibc and -9999. Should I make another bug report?
Comment 9 Philippe Michaud-Boudreault 2024-06-25 05:21:53 UTC
Good day.

File-9999 with seccomp under glibc and the latest kernel also fails.
Should I file a fresh bug report about this?
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-25 05:23:43 UTC
Yes, it's not the same issue.
Comment 11 Mike Gilbert gentoo-dev 2024-06-25 16:32:44 UTC
(In reply to Sven E. from comment #5)

We really need the full strace log; what you have provided is insufficient.
Comment 12 Mike Gilbert gentoo-dev 2024-06-25 16:34:15 UTC
Or at the very least, we need to know what syscall was made when the program received SIGSYS. The snippet you have provided fails to capture this.
Comment 13 Sven E. 2024-06-26 20:56:36 UTC
Created attachment 896457 [details]
file.300k.strace.xz

Last 300K Lines of strace, hopefully includes said call.
Comment 14 Mike Gilbert gentoo-dev 2024-06-26 21:40:33 UTC
From the log:

354795 faccessat2(AT_FDCWD, "magic/Header", F_OK, AT_EACCESS) = -1 ENOSYS (Function not implemented)
354795 getuid()                         = ?
354795 +++ killed by SIGSYS +++

This has already been resolved in >=sys-apps/file-5.45-r2.

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dbbbf5f526aff28f9c8ba79c7a277bc3aa09398b