summaryrefslogtreecommitdiff
path: root/src/basic/missing_syscall.h
Commit message (Collapse)AuthorAgeFilesLines
* missing: add more defines to fsopen() definitionsLennart Poettering2023-03-091-0/+12
|
* missing: add fsmount() syscall fallback definitionLennart Poettering2023-03-091-0/+20
|
* sd-event: reenable epoll_pwait2()Lennart Poettering2022-11-231-38/+0
| | | | | | | | | | | | | | | | This reenables epoll_pwait2() use, i.e. undoes the effect of 39f756d3ae4765b8bf017567a12b8a4b358eaaf5. Instead of just reverting that, this PR will change things so that we strictly rely on glibc's new epoll_pwait2() wrapper (which was added earlier this year), and drop our own manual fallback syscall wrapper. That should nicely side-step any issues with correct syscall wrapping definitions (which on some arch seem not to be easy, given the sigset_t size final argument), by making this a glibc problem, not ours. Given that the only benefit this delivers are time-outs more granular than msec, it shouldn't really matter that we'll miss out on support for this on systems with older glibcs.
* missing_syscall: Add rt_tgsigqueueinfo()Daan De Meyer2022-11-161-0/+14
|
* namespace: Add hidepid/subset support checkDaan De Meyer2022-11-011-0/+40
| | | | | | Using fsopen()/fsconfig(), we can check if hidepid/subset are supported to avoid the noisy logs from the kernel if they aren't supported. This works on centos/redhat 8 as well since they've backported fsopen()/fsconfig().
* missing-syscall: define MOVE_MOUNT_T_EMPTY_PATH if missingRomain Naour2022-03-281-0/+4
| | | | | | | MOVE_MOUNT_T_EMPTY_PATH has been added to systemd 250 by [1] but it's defined in kernel headers since version 5.2. [1] c7bf079bbc19e3b409acc0c7acc3e14749211fe2
* random-util: use ssize_t for getrandom return valueMike Gilbert2021-12-261-1/+2
| | | | This matches the prototype provided by glibc.
* missing-syscall: define all MOUNT_ATTR_* if missingYu Watanabe2021-12-241-6/+42
| | | | Fixes #21876.
* missing: add missing header inclusionsLennart Poettering2021-11-031-0/+1
| | | | These headers should work without any manual header inclusion.
* mount-util: use modern mount_setattr() syscall for ↵Lennart Poettering2021-10-251-0/+8
| | | | | | | bind_remount_one_with_mountinfo() New kernels have a nice syscall for changing bind mount flags. Let's use it. This makes the complex libmount based iteration logic unnecessary.
* missing: add getdents64() syscall wrapperLennart Poettering2021-10-111-0/+16
| | | | | | | | glibc 2.30 (Aug 2019) added a wrapper for getdents64(). For older versions let's define our own. (This syscall exists since Linux 2.4, hence should be safe to use for us)
* Define ioprio_{get,set} the same as other compat syscallsZbigniew Jędrzejewski-Szmek2021-09-221-0/+20
|
* missing: add syscall wrappers for new mount APILennart Poettering2021-04-281-0/+95
|
* missing_syscall: add epoll_pwait2() wrapperLennart Poettering2021-02-261-0/+43
|
* src/basic: generate missing syscall headers programaticallyZbigniew Jędrzejewski-Szmek2021-01-151-502/+3
| | | | | | | | | | | | | | | | | | | Getting the numbers right for all architectures has proven to be a constant chore. Let's autogenerate the header from the tables that were imported in one of the previous commits. Fixes #18074. (Hopefully. I cannot verify this on all architectures.) To update the lists, or to update the header after template changes: ninja -C build update-syscall-tables update-syscall-header Note: the generated file is saved in git. Initially I wanted to only store the tables in git, and generate the header during each build. Generation is quick enough, but the header is used in many many places (wherever missing_syscall.h is included, directly or indirectly), which means that we would need to declare the dependency in meson, so the header would be generated early enough. This turned out to be very noisy. Storing the generated header in version control avoids the hassle.
* missing: update warning messagesYu Watanabe2020-12-081-9/+9
|
* missing: add missing syscalls for ia64, m68k, sparc, arc, and tilegxYu Watanabe2020-12-081-8/+58
| | | | | These are not tested, but several syscalls are defined for these architectures. Let's add syscalls comprehensively.
* missing: drop redundant conditionYu Watanabe2020-12-081-5/+5
|
* missing: support 32bit powerpcYu Watanabe2020-12-081-2/+2
|
* missing: sort architectures in missing_syscall.hYu Watanabe2020-12-081-130/+132
|
* missing: Define several syscall numbers for Alpha archMatt Turner2020-12-071-0/+16
|
* Merge pull request #17079 from keszybz/late-exec-resolutionLennart Poettering2020-12-031-0/+19
|\ | | | | Resolve executable paths before execution, use fexecve()
| * shared/exec-util: use our own execveat() wrapper instead of fexecve()Zbigniew Jędrzejewski-Szmek2020-11-061-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For scripts, when we call fexecve(), on new kernels glibc calls execveat(), which fails with ENOENT, and then we fall back to execve() which succeeds: [pid 63039] execveat(3, "", ["/home/zbyszek/src/systemd/test/test-path-util/script.sh", "--version"], 0x7ffefa3633f0 /* 0 vars */, AT_EMPTY_PATH) = -1 ENOENT (No such file or directory) [pid 63039] execve("/home/zbyszek/src/systemd/test/test-path-util/script.sh", ["/home/zbyszek/src/systemd/test/test-path-util/script.sh", "--version"], 0x7ffefa3633f0 /* 0 vars */) = 0 But on older kernels glibc (some versions?) implement a fallback which falls into the same trap with bash $0: [pid 13534] execve("/proc/self/fd/3", ["/home/test/systemd/test/test-path-util/script.sh", "--version"], 0x7fff84995870 /* 0 vars */) = 0 We don't want that, so let's call execveat() ourselves. Then we can do the execve() fallback as we want.
* | missing: define several syscall numbers for MIPS archYu Watanabe2020-11-161-65/+79
| | | | | | | | Fixes #17591.
* | license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|/
* missing: add close_range() wrapperLennart Poettering2020-10-141-0/+46
| | | | | The syscall was added in 5.9 and is not yet exposed in glibc, hence define our own wrapper.
* missing_syscall: fixup syscall numbers for x32 vs. amd64mirabilos2020-10-091-11/+17
|
* missing-syscall: fix copypastaLennart Poettering2020-10-081-1/+1
| | | | | | As noticed by @mbiebl: https://github.com/systemd/systemd/commit/5134e18eedc30bfe5397ed31f94903d984a60cfc#r43033443
* basic/missing_syscall: fix syscall numbers for mips*Michael Biebl2020-10-081-2/+26
| | | | | Thanks Christian Brauner @brauner Fixes: #17261
* basic/missing_syscall: fix syscall numbers for arm64 :(Zbigniew Jędrzejewski-Szmek2020-08-241-3/+5
|
* basic/missing_syscall: add missing calls for s390x/ppc64el/arm64Zbigniew Jędrzejewski-Szmek2020-08-241-1/+19
|
* missing_syscall: verify our fallback numbers when possibleZbigniew Jędrzejewski-Szmek2020-08-241-245/+345
| | | | | | | | | | | | | | | | | | | | Instead of defining the numbers only as fallback, always define our fallback number, and if we have the real __NR_foo define, assert that our number matches the real one. This will result in warnings when our fallback number is not defined, even if the kernel headers are new enough to define __NR_foo. This will probably annoy people compiling for seldom-used architectures, but hopefully it'll provide motivation to add the missing fallback defines. The upside is that we have a higher chance of catching the cases where we got the number wrong. Calling the wrong syscall is quite problematic, and with some back luck, it might take us a long time to notice that we got the number wrong on some rarely used architecture. Also, rework some of the fallback wrappers to not call the syscall with a negative number (that'd fail, but we'd got to the kernel and back). It seems nicer to let the compiler know that this can never succeed.
* mountpoint-util: use new kernel 5.8 statx() API for determining mnt_idLennart Poettering2020-08-191-1/+1
| | | | | | | | The kernel finally has a proper API to determine the mnt_id of a file. Let's use it. This adds support for the STATX_MNT_ID field of statx(), added in kernel 5.8.
* missing_syscall: do not use function name that may conflict with glibcZbigniew Jędrzejewski-Szmek2020-08-171-4/+10
| | | | | This was done for all replacements back in 5187dd2c403caf92d09f3491e41f1ceb3f10491f, but some newer stuff didn't do this.
* missing_syscall: fix pidfd_{send_signal,open} numbers for alphaZbigniew Jędrzejewski-Szmek2020-08-171-22/+32
| | | | | | | Also order the syscalls by syscall number for easier comparisons with the kernel headers. Fixup for 5f152f43d04e5aad6a3f98f45f020a66e3aac717.
* missing_syscall: add forgotten check for __NR_get_mempolicy nonnegativityZbigniew Jędrzejewski-Szmek2020-08-171-1/+1
| | | | | | We do it in other cases, we should here too. Fixup for b070c7c0e13.
* seccomp: real syscall numbers are >= 0Mike Gilbert2019-12-091-16/+16
| | | | | | | Real syscall numbers start at 0. The fake seccomp values seem to be strictly less than 0. Fixes: 4df8fe8415eaf4abd5b93c3447452547c6ea9e5f
* missing: add rt_sigqueueinfo() syscall definitionLennart Poettering2019-12-041-0/+6
| | | | | | | | This is not a new system call at all (since kernel 2.2), however it's not exposed in glibc (a wrapper is exposed however in sigqueue(), but it substantially simplifies the system call). Since we want a nice fallback for sending signals on non-pidfd systems for pidfd_send_signal() let's wrap rt_sigqueueinfo() since it takes the same siginfo_t parameter.
* missing: define new pidfd syscallsLennart Poettering2019-12-041-0/+38
|
* seccomp: more comprehensive protection against libseccomp's __NR_xyz ↵Lennart Poettering2019-11-151-5/+5
| | | | | | | | | namespace invasion A follow-up for 59b657296a2fe104f112b91bbf9301724067cc81, adding the same conditioning for all cases of our __NR_xyz use. Fixes: #14031
* src/basic/missing_syscall: add comment lines for PR 13319 changesDan Streetman2019-08-151-0/+9
| | | | | | | Add a comment line explaining that the syscall defines might be defined to invalid negative numbers, as libseccomp redefines them to negative numbers if not defined by the kernel headers, which is not obvious just from reading the code checking for defined && > 0
* src/basic/missing_syscall: change #ifndef to #if ! (defined && > 0)Dan Streetman2019-08-141-9/+36
| | | | | | | | | | | | | | | | | | | | | | | The #ifndef check used to work for missing __NR_* syscall defines, but unfortunately libseccomp now redefines missing syscall number to negative numbers, in their public header file, e.g.: https://github.com/seccomp/libseccomp/blob/master/include/seccomp.h.in#L801 When systemd is built, since it includes <seccomp.h>, it pulls in the incorrect negative value for any __NR_* syscall define that's included in the seccomp.h header (for those syscalls that the kernel headers don't yet define, e.g. when built with older/stable-distro kernels). This leads to bugs like: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1821625 This changes the check so that it can override the negative number that libseccomp defines, instead of trying to use the negative syscall number. To avoid gcc warnings (which are failures with meson --werror), this checks without generating a redefinition gcc warning. I have no idea why libseccomp decided to define missing syscalls to negative numbers inside their *public* header file, causing problems like this.
* src/basic/missing_syscall: add s390 syscall number for __NR_pkey_mprotectDan Streetman2019-08-131-0/+2
| | | | | The syscall number for s390 was added to the kernel at: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b41c51c8e194c0bdfb4b1778a137aea8246c86cd
* tree-wide: drop duplicated blank linesYu Watanabe2019-07-151-1/+0
| | | | | | | ``` $ for i in */*.[ch] */*/*.[ch]; do sed -e '/^$/ {N; s/\n$//g}' -i $i; done $ git checkout HEAD -- basic/linux shared/linux ```
* core: introduce NUMAPolicy and NUMAMask optionsMichal Sekletar2019-06-241-0/+43
| | | | | | | | | | | | | Make possible to set NUMA allocation policy for manager. Manager's policy is by default inherited to all forked off processes. However, it is possible to override the policy on per-service basis. Currently we support, these policies: default, prefer, bind, interleave, local. See man 2 set_mempolicy for details on each policy. Overall NUMA policy actually consists of two parts. Policy itself and bitmask representing NUMA nodes where is policy effective. Node mask can be specified using related option, NUMAMask. Default mask can be overwritten on per-service level.
* missing_syscall.h: include errno.hFabrice Fontaine2019-01-111-0/+1
| | | | | | | | | This include is needed for errno and ENOSYS Fixes: - http://autobuild.buildroot.org/results/699c078aa078240c6741da4dbd0871450ceeca92 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
* missing: move syscall related definitions to missing_syscall.hYu Watanabe2018-12-061-1/+11
|
* util: drop missing.h from util.hYu Watanabe2018-12-041-0/+2
|
* missing: move statx related definitions to missing_stat.hYu Watanabe2018-12-041-0/+1
|
* missing: move missing entries in keyctl.h to missing_keyctl.hYu Watanabe2018-12-041-0/+2
|