laanwj
commented at 10:11 PM on October 4, 2021:
member
Looks like we've broke the GUIX build in #20487. This attempts to fix it:
Define __NR_statx__NR_getrandom__NR_membarrier as some kernel headers lack them, and it's important to have the same profile independent on what kernel is used for building.
Define SECCOMP_RET_KILL_PROCESS as it isn't defined in the headers.
laanwj added the label Build system on Oct 4, 2021
laanwj added the label Utils/log/libs on Oct 4, 2021
laanwj requested review from practicalswift on Oct 4, 2021
laanwj requested review from dongcarl on Oct 4, 2021
laanwj
commented at 10:21 PM on October 4, 2021:
member
Thinking of it, I'm not sure this is the right solution. statx is not directly used by us, but by libc. What if the resulting binary is run against a more recent version of libc (remember, we link libc dynamically), it will use the system call but not be allowed to, so fail?
Might be better to do
#ifndef __NR_statx
#define __NR_statx 332
#endif
…instead
And the same for __NR_getrandom and __NR_membarrier.
Edit: pushed this new solution
util: Define SECCOMP_RET_KILL_PROCESS if not provided by the headers
Define `SECCOMP_RET_KILL_PROCESS` as it isn't defined in the headers, as
is the case for the GUIX build on this platform.
8289d19ea5
laanwj force-pushed on Oct 5, 2021
MarcoFalke added the label DrahtBot Guix build requested on Oct 5, 2021
laanwj force-pushed on Oct 5, 2021
MarcoFalke referenced this in commit c79d9fb2f6 on Oct 5, 2021
practicalswift approved
practicalswift
commented at 9:54 AM on October 5, 2021:
contributor
cr ACK1685d1221e7e605ff073df94e223420691afa079
This might be helpful for fellow reviewers:
$ grep -E '(statx|getrandom|membarrier)$' linux/arch/x86/entry/syscalls/syscall_64.tbl
318 common getrandom sys_getrandom
324 common membarrier sys_membarrier
332 common statx sys_statx
$ grep SECCOMP_RET_KILL_PROCESS linux/include/uapi/linux/seccomp.h
#define SECCOMP_RET_KILL_PROCESS 0x80000000U /* kill the process */
MarcoFalke
commented at 10:09 AM on October 5, 2021:
member
laanwj
commented at 12:02 PM on October 5, 2021:
member
Can remove this line now?
I'm still not decided what I want to do with that table, but i i's supposed to be more or less platform-independent (see also discussion here: #20487 (review) ). I left the conditional like this for platforms that really don't have the getrandom/membarrier call.
util: Make sure syscall numbers used in profile are defined
Define the following syscall numbers for x86_64, so that the profile
will be the same no matter what kernel is built against, including
kernels that don't have `__NR_statx`:
```c++
#define __NR_statx 332
#define __NR_getrandom 318
#define __NR_membarrier 324
```
2d0279987e
laanwj force-pushed on Oct 5, 2021
laanwj
commented at 12:43 PM on October 5, 2021:
member
Anyhow, removed them and force-pushed. I agree it's also somewhat confusing and they can always be added again.
practicalswift
commented at 12:56 PM on October 5, 2021:
contributor
cr ACK2d0279987ef04edda5f61c171768b9527cc936cc
Thanks for quickly resolving this!
practicalswift
commented at 2:15 PM on October 5, 2021:
contributor
FWIW this is how minijail (a sandboxing and containment tool used in Chrome OS and Android) handles this:
/* Ideally minijail is compiled against a modern libc, which has modern copies
* of Linux uapi for ioctls, and unistd.h for syscalls. However, sometimes this
* isn't possible - such as when building with the Android host toolchain - so
* locally define the system calls in use in active seccomp policy files.
* This UAPI is taken from sanitized bionic headers.
*/
#ifndef __NR_copy_file_range
#ifdef __x86_64__
#define __NR_copy_file_range 326
#elif __i386__
#define __NR_copy_file_range 377
#elif __arm64__
#define __NR_copy_file_range 285
#endif
#endif /* __NR_copy_file_range */
…
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:14 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me