<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/compat/linux, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>linux/futex: Don't load a timeout when try-locking a mutex</title>
<updated>2026-07-07T23:28:55+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2026-07-07T22:52:56+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=407c7c339adb429efcb6658accd16399031c34ca'/>
<id>407c7c339adb429efcb6658accd16399031c34ca</id>
<content type='text'>
linux_sys_futex() does not copyin a timespec for the timeout if the
operation is LINUX_FUTEX_TRYLOCK_PI, presumably because it doesn't make
sense to specify a timeout for a try-lock operation.  However, this
means that we pass a userspace timespec pointer to
linux_umtx_abs_timeout_init().

Modify linux_futex_lock_pi() to not initialize the timeout if we're
try-locking.

Reviewed by:	kib, dchagin
Reported by:	Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li,
		and Ke Xu from Tsinghua University using GLM-5.2 from Z.ai
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D58061
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
linux_sys_futex() does not copyin a timespec for the timeout if the
operation is LINUX_FUTEX_TRYLOCK_PI, presumably because it doesn't make
sense to specify a timeout for a try-lock operation.  However, this
means that we pass a userspace timespec pointer to
linux_umtx_abs_timeout_init().

Modify linux_futex_lock_pi() to not initialize the timeout if we're
try-locking.

Reviewed by:	kib, dchagin
Reported by:	Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li,
		and Ke Xu from Tsinghua University using GLM-5.2 from Z.ai
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D58061
</pre>
</div>
</content>
</entry>
<entry>
<title>linux: switch off interface name translation and schedule its removal</title>
<updated>2026-07-07T21:19:17+00:00</updated>
<author>
<name>Gleb Smirnoff</name>
<email>glebius@FreeBSD.org</email>
</author>
<published>2026-07-07T21:19:17+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=11bd6ade5dfdfb5160dd001542c4cfd44aed98bc'/>
<id>11bd6ade5dfdfb5160dd001542c4cfd44aed98bc</id>
<content type='text'>
Modern Linuxes don't use ethX for almost 15 years already, see [1] and
[2].  The translation logic has always been a source of bugs and PITA.
Switch default to not translate (long due!) and schedule removal of the
code for FreeBSD 17.

[1] https://systemd.io/PREDICTABLE_INTERFACE_NAMES/
[2] https://www.freedesktop.org/software/systemd/man/latest/systemd.net-naming-scheme.html

Reviewed by:		iwtcex_gmail.com, vvd, melifaro, dchagin
Differential Revision:	https://reviews.freebsd.org/D57852
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Modern Linuxes don't use ethX for almost 15 years already, see [1] and
[2].  The translation logic has always been a source of bugs and PITA.
Switch default to not translate (long due!) and schedule removal of the
code for FreeBSD 17.

[1] https://systemd.io/PREDICTABLE_INTERFACE_NAMES/
[2] https://www.freedesktop.org/software/systemd/man/latest/systemd.net-naming-scheme.html

Reviewed by:		iwtcex_gmail.com, vvd, melifaro, dchagin
Differential Revision:	https://reviews.freebsd.org/D57852
</pre>
</div>
</content>
</entry>
<entry>
<title>linuxulator: Fix operator precedence for LINUX_XATTR_FLAGS in setxattr()</title>
<updated>2026-07-02T11:17:01+00:00</updated>
<author>
<name>YAO, Xin</name>
<email>mr.yaoxin@outlook.com</email>
</author>
<published>2026-07-01T20:10:13+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=8ad097de02263d92df3368a2f5035faa365e7956'/>
<id>8ad097de02263d92df3368a2f5035faa365e7956</id>
<content type='text'>
The LINUX_XATTR_FLAGS macro expands to (LINUX_XATTR_CREATE|LINUX_XATTR_REPLACE).
Without parentheses around the macro expansion, the bitwise &amp; operator has
higher precedence than |, causing incorrect flag evaluation and a compiler
warning.

Add the missing parentheses around LINUX_XATTR_FLAGS to ensure correct
operator grouping, matching the existing usage in getxattr().

Signed-off-by:	YAO, Xin &lt;mr.yaoxin@outlook.com&gt;
Fixes:		2c905456312b ("linuxulator: Fix O_PATH file descriptors errno for f*xattr(2)")
Reviewed by:	kib
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2306
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The LINUX_XATTR_FLAGS macro expands to (LINUX_XATTR_CREATE|LINUX_XATTR_REPLACE).
Without parentheses around the macro expansion, the bitwise &amp; operator has
higher precedence than |, causing incorrect flag evaluation and a compiler
warning.

Add the missing parentheses around LINUX_XATTR_FLAGS to ensure correct
operator grouping, matching the existing usage in getxattr().

Signed-off-by:	YAO, Xin &lt;mr.yaoxin@outlook.com&gt;
Fixes:		2c905456312b ("linuxulator: Fix O_PATH file descriptors errno for f*xattr(2)")
Reviewed by:	kib
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2306
</pre>
</div>
</content>
</entry>
<entry>
<title>linuxulator: Add linux_extattr_get_vp() for atomic getxattr</title>
<updated>2026-07-01T08:38:32+00:00</updated>
<author>
<name>YAO, Xin</name>
<email>mr.yaoxin@outlook.com</email>
</author>
<published>2026-06-29T01:55:25+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=2fc95fe26e725439209217f53dd76437a52be76b'/>
<id>2fc95fe26e725439209217f53dd76437a52be76b</id>
<content type='text'>
Move the atomic size-probe-and-read logic into a new
linux_extattr_get_vp() function in linux_xattr.c instead of
modifying the generic extattr_get_vp() in vfs_extattr.c.
This keeps Linux-specific getxattr semantics (ERANGE on
too-small buffer, EOPNOTSUPP to ENOATTR mapping)
self-contained within the linuxulator.

The function probes the attribute size and reads the data
under a single vnode lock, preventing a TOCTOU race between
the size probe and data read.

Signed-off-by:	YAO, Xin &lt;mr.yaoxin@outlook.com&gt;
Reviewed by:	kib
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2263
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the atomic size-probe-and-read logic into a new
linux_extattr_get_vp() function in linux_xattr.c instead of
modifying the generic extattr_get_vp() in vfs_extattr.c.
This keeps Linux-specific getxattr semantics (ERANGE on
too-small buffer, EOPNOTSUPP to ENOATTR mapping)
self-contained within the linuxulator.

The function probes the attribute size and reads the data
under a single vnode lock, preventing a TOCTOU race between
the size probe and data read.

Signed-off-by:	YAO, Xin &lt;mr.yaoxin@outlook.com&gt;
Reviewed by:	kib
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2263
</pre>
</div>
</content>
</entry>
<entry>
<title>linuxulator: Fix O_PATH file descriptors errno for f*xattr(2)</title>
<updated>2026-07-01T08:38:05+00:00</updated>
<author>
<name>YAO, Xin</name>
<email>mr.yaoxin@outlook.com</email>
</author>
<published>2026-05-07T06:39:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=2c905456312b2e5986afe3402a9c87d49eb9cf86'/>
<id>2c905456312b2e5986afe3402a9c87d49eb9cf86</id>
<content type='text'>
LTP open13 expects these operations to fail with EBADF, matching
Linux behavior, but FreeBSD currently returns EOPNOTSUPP
for fgetxattr() on an O_PATH fd

Look up Linux fd-based xattr descriptors with getvnode()
and route the operations through shared kern_extattr_*_fp()
helpers so the O_PATH check and the extattr operation use the
same referenced file.

Apply the same EBADF handling to fsetxattr(), fremovexattr(), and
flistxattr() so the xattr paths stay consistent.

Signed-off-by:	YAO, Xin &lt;mr.yaoxin@outlook.com&gt;
PR:		295537
Reviewed by:	kib
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2263
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
LTP open13 expects these operations to fail with EBADF, matching
Linux behavior, but FreeBSD currently returns EOPNOTSUPP
for fgetxattr() on an O_PATH fd

Look up Linux fd-based xattr descriptors with getvnode()
and route the operations through shared kern_extattr_*_fp()
helpers so the O_PATH check and the extattr operation use the
same referenced file.

Apply the same EBADF handling to fsetxattr(), fremovexattr(), and
flistxattr() so the xattr paths stay consistent.

Signed-off-by:	YAO, Xin &lt;mr.yaoxin@outlook.com&gt;
PR:		295537
Reviewed by:	kib
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2263
</pre>
</div>
</content>
</entry>
<entry>
<title>linux_prlimit(): block execve for the target</title>
<updated>2026-06-21T11:46:53+00:00</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2026-06-07T19:21:40+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e41c28e67fac9cd22a85b160c5c9d0477ed03600'/>
<id>e41c28e67fac9cd22a85b160c5c9d0477ed03600</id>
<content type='text'>
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D57497
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D57497
</pre>
</div>
</content>
</entry>
<entry>
<title>linux: implement SO_PASSRIGHTS</title>
<updated>2026-06-19T04:03:30+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2026-06-19T04:03:30+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=59bd4840df037a6898b4e9d917a530bce113f053'/>
<id>59bd4840df037a6898b4e9d917a530bce113f053</id>
<content type='text'>
We have a native version now, plumb it through to the Linuxolator.

Reviewed by:	glebius, markj
Differential Revision:	https://reviews.freebsd.org/D57427
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We have a native version now, plumb it through to the Linuxolator.

Reviewed by:	glebius, markj
Differential Revision:	https://reviews.freebsd.org/D57427
</pre>
</div>
</content>
</entry>
<entry>
<title>linux: Add TCP_INFO support</title>
<updated>2026-06-10T00:23:24+00:00</updated>
<author>
<name>Chuck Tuffli</name>
<email>chuck@FreeBSD.org</email>
</author>
<published>2026-06-10T00:22:49+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=925ca9b8355d10a0dc85175dc865095c9b3370c4'/>
<id>925ca9b8355d10a0dc85175dc865095c9b3370c4</id>
<content type='text'>
Implement the getsockopt for TCP_INFO by mapping FreeBSD's version to
what Linux expects.

MFC after:	1 month
Relnotes:	yes
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D55882
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement the getsockopt for TCP_INFO by mapping FreeBSD's version to
what Linux expects.

MFC after:	1 month
Relnotes:	yes
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D55882
</pre>
</div>
</content>
</entry>
<entry>
<title>linux: Correct the issetugid check in copyout_auxargs</title>
<updated>2026-06-09T19:13:21+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2026-05-29T21:41:35+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d39be1b1b50df91ad7ab62b25a4a30343e94cba5'/>
<id>d39be1b1b50df91ad7ab62b25a4a30343e94cba5</id>
<content type='text'>
The runtime linker in glibc relies on the AT_SECURE auxv entry to know
whether the executable is set-ugid, if so then various dangerous
functionality such as LD_PRELOAD is disabled.

The check added in commit 669414e4fb74 failed to take into account the
fact that during execve, P_SUGID may not yet be set for a set-ugid
process.  Correct the test.

Approved by:	so
Security:	FreeBSD-SA-26:30.linux
Security:	CVE-2026-49413
Reported by:	Minseong Kim
Fixes:		669414e4fb74 ("Implement AT_SECURE properly.")
Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D57350
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The runtime linker in glibc relies on the AT_SECURE auxv entry to know
whether the executable is set-ugid, if so then various dangerous
functionality such as LD_PRELOAD is disabled.

The check added in commit 669414e4fb74 failed to take into account the
fact that during execve, P_SUGID may not yet be set for a set-ugid
process.  Correct the test.

Approved by:	so
Security:	FreeBSD-SA-26:30.linux
Security:	CVE-2026-49413
Reported by:	Minseong Kim
Fixes:		669414e4fb74 ("Implement AT_SECURE properly.")
Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D57350
</pre>
</div>
</content>
</entry>
<entry>
<title>linux: Fix sockopt copyout</title>
<updated>2026-06-08T21:20:14+00:00</updated>
<author>
<name>Chuck Tuffli</name>
<email>chuck@FreeBSD.org</email>
</author>
<published>2026-06-08T21:19:34+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=471fdd91d9156aeab026dc420fb97d97be872d65'/>
<id>471fdd91d9156aeab026dc420fb97d97be872d65</id>
<content type='text'>
The Linux getsockopt did not check the size of the provided buffer when
copying out the value, leading to buffer overflows (e.g., for TCP_INFO).

Fix is to use the smaller of the option value size and the provided
buffer.

MFC after:	1 month
Relnotes:	yes
Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D55881
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Linux getsockopt did not check the size of the provided buffer when
copying out the value, leading to buffer overflows (e.g., for TCP_INFO).

Fix is to use the smaller of the option value size and the provided
buffer.

MFC after:	1 month
Relnotes:	yes
Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D55881
</pre>
</div>
</content>
</entry>
</feed>
