]>
CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
Dmitry Chagin [Tue, 26 Apr 2022 16:40:59 +0000 (19:40 +0300)]
Remove dead code.
is_physical_memory() dead since
235a54de .
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35056
MFC after: 2 weeks
(cherry picked from commit
fe2c9f83a6dc1cc62da177a765ce8a265894b2cd )
Dmitry Chagin [Tue, 26 Apr 2022 16:35:59 +0000 (19:35 +0300)]
linux(4): Add epoll_pwai2 syscall.
MFC after: 2 weeks
(cherry picked from commit
e00aad1042e7163865763b42d8d72137eeb9df63 )
Dmitry Chagin [Fri, 17 Jun 2022 19:34:09 +0000 (22:34 +0300)]
linux(4): Regen for epoll_pwait2 syscall.
(cherry picked from commit
df377f1fb8dd92a1839bc578aac46d2cdf1b5b84 )
Dmitry Chagin [Tue, 26 Apr 2022 16:35:57 +0000 (19:35 +0300)]
linux(4): Change epoll_pwait2 syscall definition to match Linux actual one.
MFC after: 2 weeks
(cherry picked from commit
81b0b7dc0c624c2e086943822beda0b08a12e252 )
Dmitry Chagin [Tue, 26 Apr 2022 16:35:57 +0000 (19:35 +0300)]
linux(4): Add copyin_sigset() helper.
MFC after: 2 weeks
(cherry picked from commit
3923e632094a7e4cc66cd8e68964b9cb495119e2 )
Dmitry Chagin [Tue, 26 Apr 2022 16:35:56 +0000 (19:35 +0300)]
linux(4): Add linux_epoll_pwait_ts() helper for future use.
MFC after: 2 weeks
(cherry picked from commit
27a25179c8356d58b5df6303d850050122f020c6 )
Dmitry Chagin [Tue, 26 Apr 2022 16:35:56 +0000 (19:35 +0300)]
linux(4): Copyout pselect timeout.
According to pselect6 manual, on error timeout becomes undefined, by fact
Linux modifies the timeout and ignore EFAULT error if so.
MFC after: 2 weeks
(cherry picked from commit
5171ed79f6d1fc3948a7ebfb32b02d698224c29b )
Dmitry Chagin [Tue, 26 Apr 2022 16:35:56 +0000 (19:35 +0300)]
linux(4): Add a simple rseq syscall implementation.
To avoid annoyng messages from glibc-2.35 test suite add the simple
implementation of rseq syscall which is do nothing for now.
I plan to implement it if and when the API stabilizes.
MFC after: 2 weeks
(cherry picked from commit
ee55d560e89ac8de37def993a13d2582638273b7 )
Dmitry Chagin [Fri, 17 Jun 2022 19:34:03 +0000 (22:34 +0300)]
linux(4): Regen for rseq syscall.
(cherry picked from commit
75e409495f67a39114e09224b8915cb0ecc481c4 )
Dmitry Chagin [Tue, 26 Apr 2022 16:35:54 +0000 (19:35 +0300)]
linux(4): Change rseq syscall definition to match Linux actual one.
MFC after: 2 weeks
(cherry picked from commit
f202f35db00cb9908b143a5a67f58ee95310f419 )
Dmitry Chagin [Mon, 25 Apr 2022 11:45:05 +0000 (14:45 +0300)]
Fix build after
128b9bf9
MFC after: 2 weeks
(cherry picked from commit
0ced2aef06760bfc57248482045c997be718b207 )
Dmitry Chagin [Fri, 17 Jun 2022 19:33:56 +0000 (22:33 +0300)]
Add tests for sigwait family syscalls.
MFC after: 2 weeks
(cherry picked from commit
128b9bf96cae36c33b45a4d418ff502497bbb834 )
Dmitry Chagin [Mon, 25 Apr 2022 07:23:15 +0000 (10:23 +0300)]
sigtimedwait: Prevent timeout math overflows.
Our kern_sigtimedwait() calculates absolute sleep timo value as 'uptime+timeout'.
So, when the user specifies a big timeout value (LONG_MAX), the calculated
timo can be less the the current uptime value.
In that case kern_sigtimedwait() returns EAGAIN instead of EINTR, if
unblocked signal was caught.
While here switch to a high-precision sleep method.
Reviewed by: mav, kib
In collaboration with: mav
Differential revision: https://reviews.freebsd.org/D34981
MFC after: 2 weeks
(cherry picked from commit
4a700f3c329a48f3a20fd576900820e293c8cad7 )
Dmitry Chagin [Mon, 25 Apr 2022 07:22:51 +0000 (10:22 +0300)]
linux(4): Refactor signal send methods.
Created a couple of helpers to send signals to the specific thread or to
the whole process. Use helpers in the corresponding syscalls.
This fixes the confusion where a signal destined for a whole process
was sent to a specific thread and vice versa.
There is an exclusion for the linux_kill() syscall that takes a pid
argument and should send a signal to the whole process, but I know
at least one example where kill() takes tid.
MFC after: 2 weeks
(cherry picked from commit
6201a50d0d6d98633dba3db12dea2dfe95295e0e )
Dmitry Chagin [Mon, 25 Apr 2022 07:21:51 +0000 (10:21 +0300)]
linux(4): Check that the thread tid in the thread group pid in linux_tdfind().
MFC after: 2 weeks
(cherry picked from commit
fe894a370556e5b173a8893cdcde6323ff79cc57 )
Dmitry Chagin [Mon, 25 Apr 2022 07:21:20 +0000 (10:21 +0300)]
linux(4): Microoptimize bsd_to_linux_sockaddr().
Differential Revision: https://reviews.freebsd.org/D34725
MFC after: 2 weeks
(cherry picked from commit
bbddd5881d1826a366d09d1e156ec6b64d3715e5 )
Dmitry Chagin [Mon, 25 Apr 2022 07:20:54 +0000 (10:20 +0300)]
Add timespecvalid_interval macro and use it.
Reviewed by: jhb, imp (early rev)
Differential revision: https://reviews.freebsd.org/D34848
MFC after: 2 weeks
(cherry picked from commit
91e7bdcdcf10684098e213e311cdafcd7a0ac983 )
Dmitry Chagin [Thu, 21 Apr 2022 07:52:29 +0000 (10:52 +0300)]
Fix sigtimedwait manpage.
Historically, sigtimedwait() blocks indefinitely if timeout is NULL.
Reviewed by: jilles, imp
Differential Revision: https://reviews.freebsd.org/D34985
MFC after: 2 weeks
(cherry picked from commit
89ecdff2c32c4e8975f8652c5cb913eba8642204 )
Dmitry Chagin [Wed, 20 Apr 2022 14:55:32 +0000 (17:55 +0300)]
Bump Dd in getdirentries.2 after
c6487446 .
MFC after: 1 week
(cherry picked from commit
45a4c442996edafbe49caecb33a6e1226ab51a8e )
Dmitry Chagin [Mon, 11 Apr 2022 20:33:27 +0000 (23:33 +0300)]
linux(4): Copyout actual size of addr to the user space in accept().
Differential Revision: https://reviews.freebsd.org/D34727
(cherry picked from commit
673bce11cedde3cc33c154d2b8e2d41139dcef72 )
Dmitry Chagin [Mon, 11 Apr 2022 20:32:28 +0000 (23:32 +0300)]
linux(4): Limit user-supplied sockaddr length in recvfrom().
Differential Revision: https://reviews.freebsd.org/D34726
(cherry picked from commit
bb0f644cd680d20b3112f6c14dc853171f497a88 )
Dmitry Chagin [Mon, 11 Apr 2022 20:32:02 +0000 (23:32 +0300)]
linux(4): Remove unnecessary PTRIN().
(cherry picked from commit
68bfaefb3d93781730ebc63956538154173b77c8 )
Dmitry Chagin [Mon, 11 Apr 2022 20:31:28 +0000 (23:31 +0300)]
linux(4): Handle SO_DOMAIN in getsockopt syscall.
Differential revision: https://reviews.freebsd.org/D34714
(cherry picked from commit
cf312f799a867b4b1beef0536a162062659659a6 )
Dmitry Chagin [Fri, 17 Jun 2022 19:33:51 +0000 (22:33 +0300)]
getdirentries: return ENOENT for unlinked but still open directory.
To be more compatible to IEEE Std 1003.1-2008 (“POSIX.1”).
Reviewed by: mjg, Pau Amma (doc)
Differential revision: https://reviews.freebsd.org/D34680
MFC after: 2 weeks
(cherry picked from commit
c6487446d7e99537551d2e51a2f6c6569fcb89fc )
Dmitry Chagin [Mon, 11 Apr 2022 20:29:45 +0000 (23:29 +0300)]
linux(4): Prevent an attempt to copy an uninitialized source address.
PR: 259380
MFC after: 3 days
(cherry picked from commit
bb46e9b5107fd8763742f7e55b66ea2e574f5815 )
Fernando Apesteguía [Tue, 8 Mar 2022 14:19:53 +0000 (15:19 +0100)]
[linprocfs] add sys/kernel/random/boot_id
This file holds a UUID that is invariant for every boot. In our case, it is
invariant per mount.
PR: 262369
Reported by: sodynet1@gmail.com
Approved by: dchagin@
Differential Revision: https://reviews.freebsd.org/D34860
(cherry picked from commit
0f2041a5b03259a8a7b20ffc98e34884cc5590b3 )
John Baldwin [Sat, 9 Apr 2022 00:25:14 +0000 (17:25 -0700)]
i386 linux: Remove unused variables.
(cherry picked from commit
9e70163017ff929a36926ddbc5bd6e8b6b19cfeb )
Dmitry Chagin [Wed, 6 Apr 2022 14:40:00 +0000 (17:40 +0300)]
linux(4): Fix a typo in itimerspec conversion routine.
MFC after: 3 days
(cherry picked from commit
0938d04a2c513122127c4a1552542ab617f567a8 )
Dmitry Chagin [Thu, 31 Mar 2022 20:49:26 +0000 (23:49 +0300)]
linsysfs: plug set-but-not-used vars.
MFC after: 2 weeks
(cherry picked from commit
bafe3b8804ca1450584191ae8689c1c0abeea68d )
Dmitry Chagin [Thu, 31 Mar 2022 18:23:12 +0000 (21:23 +0300)]
linux(4): Cleanup empty lines.
MFC after: 2 weeks
(cherry picked from commit
09d60bfae58f10a24c8fc7c06bd3d90b86d40e07 )
Dmitry Chagin [Thu, 31 Mar 2022 18:22:31 +0000 (21:22 +0300)]
linux(4): Fix KASSERT message.
MFC after: 2 weeks
(cherry picked from commit
4e1e83461bdc9b8c3ab96dc82e7342d4ea1e69b9 )
Dmitry Chagin [Thu, 31 Mar 2022 18:21:41 +0000 (21:21 +0300)]
linux(4): readlink should fail if bufzis <= 0.
MFC after: 2 weeks
(cherry picked from commit
d6ccce0aa267db8ee57736e944520e2967896340 )
Dmitry Chagin [Thu, 31 Mar 2022 18:04:44 +0000 (21:04 +0300)]
linprocfs: Add /proc/self/oom_score_adj.
To avoid annoyng messages from LTP test suites add the simple
implementation of /proc/self/oom_score_adj which is do nothing.
Reviewed by: emaste
Differential revision: https://reviews.freebsd.org/D34710
MFC after: 2 weeks
(cherry picked from commit
b7df7b987e8fac05006aa5f132c424e2b2bcf156 )
Dmitry Chagin [Thu, 31 Mar 2022 18:01:09 +0000 (21:01 +0300)]
linux(4): Add compat.linux32.emulate_i386 knob.
Historically 32-bit Linuxulator under amd64 emulated the real i386
behavior. Since
3d8dd983 the old i386 Linux world can't be used under
amd64 Linuxulator as it don't know anything about amd64 machine (which
is returned now by newuname() syscall). So, add a knob to allow to swith
the behavior and use i386 Linux binaries on amd64.
Set knob to the new behavior as I think this is common to the modern
Linux distros.
Reviewed by: Pau Amma (doc), emaste
Differential revision: https://reviews.freebsd.org/D34708
MFC after: 2 weeks
(cherry picked from commit
d5dc757e84d8dc1db987f3a17052e32621d6ea87 )
Dmitry Chagin [Thu, 31 Mar 2022 17:50:09 +0000 (20:50 +0300)]
linux(4): Fixup miscalculation of d_off of struct dirent in getdents() syscalls.
Avoid calculating d_off value as it is specific to the underlying filesystem
and can be used by others API, like lseek(), seekdir() as input offset.
Differential revision: https://reviews.freebsd.org/D31551
MFC after: 2 weeks
(cherry picked from commit
099fa2feb36fe6a68a87dfdb0f290b882139a88d )
Dmitry Chagin [Thu, 31 Mar 2022 17:49:39 +0000 (20:49 +0300)]
linux(4): wait4() returns ESRCH if pid is INT_MIN.
Weird and undocumented patch was added to the Linux kernel in 2017,
fixes wait403 LTP test.
MFC after: 2 weeks
(cherry picked from commit
9103c5582a2d271fa8f4df136ae511da572c660f )
Dmitry Chagin [Thu, 31 Mar 2022 17:45:12 +0000 (20:45 +0300)]
linux(4): Rid unused defines from linux_mib.
Reviewed by: trasz
Differential revision: https://reviews.freebsd.org/D31591
MFC after: 2 weeks
(cherry picked from commit
5bcf0f7cd7441a1f88383545fec6c370b934f1a1 )
Dmitry Chagin [Thu, 31 Mar 2022 17:44:00 +0000 (20:44 +0300)]
linux(4): Fixup waitid handling P_PGID idtype.
Since Linux 5.4, if id is zero, then wait for any child that is in the same
process grop as the caller's process group.
Differential revision: https://reviews.freebsd.org/D31567
MFC after: 2 weeks
(cherry picked from commit
4e3aefb923ac1bd8e2a707b00239f171eab1231b )
Dmitry Chagin [Thu, 31 Mar 2022 17:42:42 +0000 (20:42 +0300)]
linux(4): Return ENOSYS for unsupported P_PIDFD waitid idtype.
Reviewed by: emaste
Differential revision: https://reviews.freebsd.org/D31559
MFC after: 2 weeks
(cherry picked from commit
be1e4a0bdf45da4bbdce996d2146eba3e32b3766 )
Dmitry Chagin [Thu, 31 Mar 2022 17:42:03 +0000 (20:42 +0300)]
linux(4): Add support for __WALL wait option bit.
As FreeBSD does not have __WALL option bit analogue explicitly set all
possible option bits to emulate Linux __WALL wait option bit.
Reviewed by: emaste
Differential revision: https://reviews.freebsd.org/D31555
MFC after: 2 weeks
(cherry picked from commit
c7ef7c3facaf663c3da2d91916bcb2f162fc300e )
Dmitry Chagin [Thu, 31 Mar 2022 17:41:19 +0000 (20:41 +0300)]
linux(4): Fixup options value validation in linux_waitid().
Reviewed by: emaste
Differential revision: https://reviews.freebsd.org/D31554
MFC after: 2 weeks
(cherry picked from commit
d7e1e138ec66e410f525413b0caed089139f3cc0 )
Dmitry Chagin [Thu, 31 Mar 2022 17:41:02 +0000 (20:41 +0300)]
linux(4): Eliminate bogus options value check validation.
The kernel do it for us.
Reviewed by: emaste
Differential revision: https://reviews.freebsd.org/D31553
MFC after: 2 weeks
(cherry picked from commit
2fd480b3182f52ebf23abdcacab04520224e90b7 )
Dmitry Chagin [Thu, 31 Mar 2022 17:40:22 +0000 (20:40 +0300)]
linux(4): Consolidate wait* facility into linux_common_wait().
Also fix bug in waitid() implementation, use wru_self not wru_children.
Differential revision: https://reviews.freebsd.org/D31552
MFC after: 2 weeks
(cherry picked from commit
0c6b1ff7de56ccaef9bb22bacfd69b07ab4aeb8a )
Mateusz Guzik [Wed, 24 Nov 2021 21:16:03 +0000 (21:16 +0000)]
linux: plug set-but-not-unused vars
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit
74a0e24f07974b4d51c57afa7525b5f88574ad31 )
Dmitry Chagin [Fri, 25 Mar 2022 14:54:23 +0000 (17:54 +0300)]
linux(4): Add AT_NO_AUTOMOUNT to statx.
Specific to Linux AT_NO_AUTOMOUNT flag tells the kernel to not automount the
terminal component of pathname if it is a directory that is an automount point.
As it is the default for FreeBSD silencly ignore this flag.
glibc-2.34 uses this flag in the stat64 system calls which is used by i386.
Reviewed by: trasz
Differential revision: https://reviews.freebsd.org/D31524
MFC after: 2 weeks
(cherry picked from commit
ff39d74aa99a49749d1de26dc1f6b1e1bfebceb0 )
Dmitry Chagin [Fri, 25 Mar 2022 14:53:08 +0000 (17:53 +0300)]
linprocfs: Eliminate bogus comment (KSE).
Reviewed by: trasz, emaste
Differential revision: https://reviews.freebsd.org/D31525
MFC after: 2 weeks
(cherry picked from commit
aae8ae5ea5a67feb83a30e7c09553ab416d6830a )
John Baldwin [Fri, 4 Feb 2022 23:57:57 +0000 (15:57 -0800)]
linux_copyout_strings: Use PROC_PS_STRINGS().
Reviewed by: markj
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D34173
(cherry picked from commit
6bea696af25c606452515bc812c23b9f2614344a )
Mateusz Guzik [Wed, 24 Nov 2021 21:18:36 +0000 (21:18 +0000)]
linprocfs: plug set-but-not-unused vars
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit
ae3d955404dac5c22fdbbc9bd1a3583b4c7d8637 )
Dmitry Chagin [Thu, 9 Dec 2021 21:41:08 +0000 (21:41 +0000)]
pseudofs: Destroy vncache hashtbl on pseudofs module unload.
Reviewed by: mjg, kib
Differential Revision: https://reviews.freebsd.org/D31605
MFC after: 2 weeks
(cherry picked from commit
0f74021fb6a5c3fb6e031892cc159b1e7e325bd6 )
Dmitry Chagin [Fri, 13 Aug 2021 08:36:42 +0000 (11:36 +0300)]
linux(4): Improve comment.
Reported by: pfg
MFC after: 2 weeks
(cherry picked from commit
d4da692862f195b8e98cbaeadbd97eb003cda92a )
Edward Tomasz Napierala [Tue, 4 Jan 2022 14:13:03 +0000 (14:13 +0000)]
linux(4): Reduce diffs between linux_rt_sendsig() and sendsig()
No functional changes (except for the uprintf).
Discussed With: kib
Sponsored By: EPSRC
(cherry picked from commit
f7b04c53de46b18785a153d9812e64ca1a9a8c8d )
Edward Tomasz Napierala [Fri, 28 Jan 2022 10:55:11 +0000 (10:55 +0000)]
linux: Provide dummy seccomp(2)
Don't emit messages; this isn't any different from a Linux kernel
built without OPTIONS_SECCOMP, so the userspace already needs to know
how to deal with it. This is also similar with how we handle seccomp
in linux_prctl().
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D33808
(cherry picked from commit
99454d3e98ff205881aa7abef39234c9afc7600c )
Edward Tomasz Napierala [Tue, 21 Dec 2021 06:07:15 +0000 (06:07 +0000)]
linux(4): Remove unused arm64 SDT declarations
Those tracepoints have been removed somewhere in the past.
Sponsored By: EPSRC
(cherry picked from commit
a15c591899663c30f2cbe13a4b350ad508b5e4bb )
Mateusz Guzik [Sat, 18 Dec 2021 13:12:15 +0000 (13:12 +0000)]
linux: plug set-but-not-used vars
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit
0c8d7eebfdce5045bf3b8669ce954ca2cf553d9a )
Mateusz Guzik [Thu, 25 Nov 2021 21:42:13 +0000 (21:42 +0000)]
linux: remove the always curthread argument from lconvpath
(cherry picked from commit
af4051d25055fee086c0f78421e68fec20640f17 )
John Baldwin [Wed, 17 Nov 2021 23:51:18 +0000 (15:51 -0800)]
linux_name_to_handle_at: Support AT_EMPTY_PATH.
Reviewed by: kib
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33050
(cherry picked from commit
8b2ce7a3bbd0a754d31ff3943d918b4c84c831a3 )
John Baldwin [Wed, 17 Nov 2021 23:51:06 +0000 (15:51 -0800)]
linux_linkat: Don't invert AT_* flags.
Reviewed by: kib
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33048
(cherry picked from commit
a8d885296a9dc517e731723081c83d97d2aa598f )
Edward Tomasz Napierala [Mon, 29 Nov 2021 16:44:40 +0000 (16:44 +0000)]
linux(4): Fix "set but not used" warnings
No functional changes.
Sponsored By: EPSRC
(cherry picked from commit
a089c17d320684e6eb36556fa131a8286e6a821d )
Dmitry Chagin [Fri, 17 Jun 2022 19:33:38 +0000 (22:33 +0300)]
linux: Drop some unnecessary includes
Drop some unnecessary includes from Linuxulator ptrace
and coredump code. No functional changes.
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32925
(cherry picked from commit
06d5ef0aad20f703c15350663ce2600bae2fe189 )
Edward Tomasz Napierala [Tue, 9 Nov 2021 11:54:06 +0000 (11:54 +0000)]
linux: Replace ifdefs in ptrace with per-architecture callbacks
It's a cleanup; no (intended) functional changes.
Sponsored By: EPSRC
Reviewed By: kib
Differential Revision: https://reviews.freebsd.org/D32888
(cherry picked from commit
0bf8d5d5f43426321940e351939b0b712f28b08f )
Edward Tomasz Napierala [Sun, 7 Nov 2021 08:22:41 +0000 (08:22 +0000)]
linux: Add ptrace(2) support on arm64
This moves linux_ptrace.c from sys/amd64/linux/ to sys/compat/linux/,
making it possible to use it on architectures other than amd64.
It also enables Linux ptrace(2) on arm64.
Relnotes: yes
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32868
(cherry picked from commit
a90ff3c4bc901947a040717f39d5b3b8778047fe )
Edward Tomasz Napierala [Sat, 6 Nov 2021 08:35:04 +0000 (08:35 +0000)]
linux: Implement linux_to_bsd_regset() on arm64
This will be used by ptrace.
Sponsored By: EPSRC
(cherry picked from commit
6f397bc0fbe378664bbbc7c2296043e3b9673e2a )
Edward Tomasz Napierala [Sat, 6 Nov 2021 07:56:51 +0000 (07:56 +0000)]
linux: Fix another amd64-specific piece of linux_ptrace.c
This was missed in
c91d0e59be1 . No functional changes.
Sponsored By: EPSRC
(cherry picked from commit
3be6e606d7870a79baa7a4c5947dffd333defa79 )
Edward Tomasz Napierala [Wed, 3 Nov 2021 08:54:30 +0000 (08:54 +0000)]
linux: Make linux_ptrace.c portable
Make sys/amd64/linux/linux_ptrace.c machine-independent,
in preparation for moving it into sys/compat/linux/.
No functional changes.
Reviewed By: kib
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32756
(cherry picked from commit
c91d0e59be10f9412cbce467b8b038f006bb6f18 )
Edward Tomasz Napierala [Wed, 3 Nov 2021 08:49:41 +0000 (08:49 +0000)]
linux: mv sys/i386/linux/linux_ptrace{,_machdep}.c
In preparation for machine-independent sys/compat/linux/linux_ptrace.c,
rename the i386-specific Linux ptrace(2) implementation. No functional
changes.
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32757
(cherry picked from commit
4dfd612286ec2ecc7a05f3d4fd65a58f4b05f74c )
Edward Tomasz Napierala [Sat, 30 Oct 2021 09:13:32 +0000 (10:13 +0100)]
linux: make PTRACE_SETREGS use a correct struct
Note that this is largely untested at this point, as was
the previous version; I'm committing this mostly to get
rid of `struct linux_pt_reg`.
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32735
(cherry picked from commit
f0d9a6a781f331440baf9a846e773e44a297d59c )
Edward Tomasz Napierala [Fri, 29 Oct 2021 15:18:13 +0000 (16:18 +0100)]
linux: make PTRACE_GETREGS return correct struct
Previously it returned a shorter struct. I can't find any
modern software that uses it, but tests/ptrace from strace(1)
repo complained.
Differential Revision: https://reviews.freebsd.org/D32601
(cherry picked from commit
ad0379660d0c77aaf0ca6ec19472b7bb173c5794 )
Edward Tomasz Napierala [Sat, 23 Oct 2021 07:33:48 +0000 (08:33 +0100)]
linux: Constify bsd_to_linux_regset()
No functional changes.
Reviewed By: emaste
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32599
(cherry picked from commit
3417c29851b6fce32b4c459b4c0a197b2e33018b )
Dmitry Chagin [Thu, 12 Aug 2021 13:07:21 +0000 (16:07 +0300)]
linux(4): Remove clone3 and faccessat2 from dummy.
MFC after: 2 weeks
(cherry picked from commit
aecd31a8a3b09af874120bc7b4aa6fa51db98f94 )
Dmitry Chagin [Thu, 12 Aug 2021 08:58:33 +0000 (11:58 +0300)]
linux(4): Remove the unnecessary spaces.
MFC after: 2 weeks
(cherry picked from commit
bed2ac27a14d39df713f004ea46cbe77fa853f86 )
Dmitry Chagin [Thu, 12 Aug 2021 08:58:17 +0000 (11:58 +0300)]
fork: Remove the unnecessary spaces.
MFC after: 2 weeks
(cherry picked from commit
71854d9b2b0953b624ffcb268f41b84c9370981b )
Dmitry Chagin [Thu, 12 Aug 2021 08:57:16 +0000 (11:57 +0300)]
linux(4): Move ff variable initialization from declaration.
Modern style(9) allows variables initialization where they are declared,
but in this case initialization obfuscate the code.
MFC after: 2 weeks
(cherry picked from commit
1af0780b5f20aaa2603bba221ff78ca22dd44bd2 )
Dmitry Chagin [Thu, 12 Aug 2021 08:56:51 +0000 (11:56 +0300)]
linux(4): Verify that higher 32bits of exit_signal in clone3 are unset.
MFC after: 2 weeks
(cherry picked from commit
c2cc5345b88e98efb85ebc7318b8f92a8455345e )
Dmitry Chagin [Thu, 12 Aug 2021 08:56:36 +0000 (11:56 +0300)]
linux(4): Return ENOSYS for unsupported clone3 option bits.
Differential Revision: https://reviews.freebsd.org/D31483
MFC after: 2 weeks
(cherry picked from commit
4385147547d9f2f8b93f08012c0a18aa6d895403 )
Dmitry Chagin [Thu, 12 Aug 2021 08:55:55 +0000 (11:55 +0300)]
linux(4): Add LINUX_RATELIMIT_MSG macro for future use.
Differential Revision: https://reviews.freebsd.org/D31488
MFC after: 2 weeks
(cherry picked from commit
0d77f6c0c350ae41acc0653a236a76d981773021 )
Dmitry Chagin [Thu, 12 Aug 2021 08:55:35 +0000 (11:55 +0300)]
linux(4): Implement CLONE_CLEAR_SIGHAND option bit.
CLONE_CLEAR_SIGHAND is designed to reset all signal handlers of the child
not set to SIG_IGN to SIG_DFL.
Reviewed by: kib
Differential revision: https://reviews.freebsd.org/D31481
MFC after: 2 weeks
(cherry picked from commit
c5fc9fe7f36a742e567173b2e3d65252140013d1 )
Dmitry Chagin [Thu, 12 Aug 2021 08:55:24 +0000 (11:55 +0300)]
linux(4): Add CLONE_PIDFD option bit.
Differential revision: https://reviews.freebsd.org/D31478
MFC after: 2 weeks
(cherry picked from commit
a796845d6de083971eef2d2a33ccc74fcd609ec7 )
Dmitry Chagin [Thu, 12 Aug 2021 08:50:22 +0000 (11:50 +0300)]
linux(4): Regen for clone3 system call.
MFC after: 2 weeks
(cherry picked from commit
b356030e670686df1300edf851e146c5d274e4f8 )
Dmitry Chagin [Thu, 12 Aug 2021 08:49:36 +0000 (11:49 +0300)]
linux(4): Implement clone3 system call.
clone3 system call is used by glibc-2.34.
Differential revision: https://reviews.freebsd.org/D31475
MFC after: 2 weeks
(cherry picked from commit
17913b0b6b707568d63559255820f3212cd31cdf )
Dmitry Chagin [Thu, 12 Aug 2021 08:49:01 +0000 (11:49 +0300)]
linux(4): Add struct clone_args for future clone3 system call.
In preparation for clone3 system call add struct clone_args and use it in
clone implementation.
Move all of clone related bits to the newly created linux_fork.h header.
Differential revision: https://reviews.freebsd.org/D31474
MFC after: 2 weeks
(cherry picked from commit
0a4b664ae8582b7596858317b53d84eb4f8bbf9a )
Dmitry Chagin [Thu, 12 Aug 2021 08:47:31 +0000 (11:47 +0300)]
linux(4): Regen for clone syscall.
MFC after: 2 weeks
(cherry picked from commit
0c08f34f4ddff9847bd57f262270687ea1220a6a )
Dmitry Chagin [Thu, 12 Aug 2021 08:46:36 +0000 (11:46 +0300)]
linux(4): Change clone syscall definition to match Linux actual one.
Differential revision: https://reviews.freebsd.org/D31473
MFC after: 2 weeks
(cherry picked from commit
f1c450492f81cda4bddd46dc71ea4c92907567ac )
Dmitry Chagin [Fri, 17 Jun 2022 19:33:28 +0000 (22:33 +0300)]
fork: Allow ABI to specify fork return values for child.
At least Linux x86 ABI's does not use carry bit and expects that the dx register
is preserved. For this add a new sv_set_fork_retval hook and call it from cpu_fork().
Add a short comment about touching dx in x86_set_fork_retval(), for more details
see phab comments from kib@ and imp@.
Reviewed by: kib
Differential revision: https://reviews.freebsd.org/D31472
MFC after: 2 weeks
(cherry picked from commit
de8374df28cc23ce0d893fd96d1ad0a861414154 )
Dmitry Chagin [Thu, 12 Aug 2021 08:42:50 +0000 (11:42 +0300)]
linux(4): Plug in aarch64 fcntl flags.
Fixes opendir() libc function.
Differential Revision: https://reviews.freebsd.org/D31357
MFC after: 2 weeks
(cherry picked from commit
fc37be246021ee9b7110c9f506141c2bf0bc9fb0 )
Dmitry Chagin [Thu, 12 Aug 2021 08:41:35 +0000 (11:41 +0300)]
linux(4): Regen for faccessat2 system call.
MFC after: 2 weeks
(cherry picked from commit
bee191e46fc261b64fcaf440952d74a94cf4a273 )
Dmitry Chagin [Thu, 12 Aug 2021 08:40:42 +0000 (11:40 +0300)]
linux(4): Implement faccessat2 system call.
It's used by bash on arm64 with glibc-2.32.
Reviewed by: trasz
Differential Revision: https://reviews.freebsd.org/D31345
MFC after: 2 weeks
(cherry picked from commit
13d79be9950dd820628906dcad4f4f1365b307b9 )
Dmitry Chagin [Thu, 12 Aug 2021 08:36:24 +0000 (11:36 +0300)]
linux(4): Fix futex copyrights.
As no more NetBSD code in futexes exists replace NetBSD copyrights by
standard FreeBSD 2 clause license.
Add Roman Divacky's copyrights as an author of the robust futexes.
Differential revision: https://reviews.freebsd.org/D31347
MFC after: 2 weeks
(cherry picked from commit
6e31bed646c2f67cbcfd4bb2ce38aadd15868dcc )
Dmitry Chagin [Thu, 29 Jul 2021 09:56:39 +0000 (12:56 +0300)]
linux(4): Eliminate a now unused includes after futexes refactoring.
MFC after: 2 weeks
(cherry picked from commit
2411ac0b89f3a33aca93c62b53bd48deee123766 )
Dmitry Chagin [Thu, 29 Jul 2021 09:55:59 +0000 (12:55 +0300)]
linux(4): Add a comment about wait/requeue pi operations.
MFC after: 2 weeks
(cherry picked from commit
d90df8ac1324d731f8423b5501158ee870fbd5ba )
Dmitry Chagin [Thu, 29 Jul 2021 09:55:33 +0000 (12:55 +0300)]
linux(4): Handle incorrect FUTEX_CLOCK_REALTIME option bit.
Return ENOSYS if the FUTEX_CLOCK_REALTIME option bit is specified for an
inappropriate futex operation.
MFC after: 2 weeks
(cherry picked from commit
626cbd4648141929502b953111dc8a71d550c7e8 )
Dmitry Chagin [Thu, 29 Jul 2021 09:55:02 +0000 (12:55 +0300)]
linux(4): Handle FUTEX_LOCK_PI2 oeration.
FUTEX_LOCK_PI2 was added to support clock selection as FUTEX_LOCK_PI uses a
CLOCK_REALTIME based absolute value since it was implemented, but it does not
require that the FUTEX_CLOCK_REALTIME bit is set, because that was introduced
later.
MFC after: 2 weeks
(cherry picked from commit
a9bb1b1c188339ed7658103ff5843c161df08799 )
Dmitry Chagin [Thu, 29 Jul 2021 09:54:32 +0000 (12:54 +0300)]
linux(4): Use variable name not type for sizeof() to calculate storage size.
MFC after: 2 weeks
(cherry picked from commit
bd25bf092ae92f5a46eed51a3152c9af4cb0f7b3 )
Dmitry Chagin [Thu, 29 Jul 2021 09:54:16 +0000 (12:54 +0300)]
linux(4): Move len variable initialization to the appropriate place.
MFC after: 2 weeks
(cherry picked from commit
49a5c0409bf15fc00bbe363fe7090d7b7c601985 )
Dmitry Chagin [Thu, 29 Jul 2021 09:53:59 +0000 (12:53 +0300)]
linux(4): Use linux_tdfind() in get_robust_list.
In the Linux emulation layer linux_tdfind() has a special purpose to
handle glibc specific TID mangling and we should use it instead of tdfind().
MFC after: 2 weeks
(cherry picked from commit
c8e9d2b7eb6ef55e1386150458c58e6554762166 )
Dmitry Chagin [Thu, 29 Jul 2021 09:53:41 +0000 (12:53 +0300)]
linux(4): Eliminate unnecessary error initialization.
MFC after: 2 weeks
(cherry picked from commit
f88d3c522f743c0d948048de3c36f9bb9e0ca171 )
Dmitry Chagin [Thu, 29 Jul 2021 09:53:25 +0000 (12:53 +0300)]
linux(4): Eliminate unnecessary head initialization.
MFC after: 2 weeks
(cherry picked from commit
6b68e8af1f8770bdc7aff66e1ae616efd9c9da46 )
Dmitry Chagin [Thu, 29 Jul 2021 09:53:07 +0000 (12:53 +0300)]
linux(4): style, wrap too long line.
MFC after: 2 weeks
(cherry picked from commit
971b53fa04f96199889f6dd6a078d054772bc7c9 )
Dmitry Chagin [Thu, 29 Jul 2021 09:52:36 +0000 (12:52 +0300)]
linux(4): Eliminating remnants of futex sdt.
MFC after: 2 weeks
(cherry picked from commit
edd44176aa0e1acdb3a97746c6fe595d12be0c45 )
Dmitry Chagin [Thu, 29 Jul 2021 09:51:56 +0000 (12:51 +0300)]
linux(4): Eliminating an accidental comment.
MFC after: 2 weeks
(cherry picked from commit
741f80df531cb58a38a8ec98203c7e315b6f9bca )
Dmitry Chagin [Thu, 29 Jul 2021 09:51:39 +0000 (12:51 +0300)]
linux(4): Handle special case for regular futex in handle_futex_death().
Handle some races in handle_futex_death() which can prevents a wakeup of
potential waiters which can cause these waiters to block forever.
Differential Revision: https://reviews.freebsd.org/D31280
MFC after: 2 weeks
(cherry picked from commit
b59cf25eac06c1feb2d35a5a3d8a089ae62fd0df )