<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/compat, branch stable/13</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>file: Add a fd flag with O_RESOLVE_BENEATH semantics</title>
<updated>2026-02-09T16:54:57+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2026-02-09T16:47:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f7cbcb19a9ecf606172d6d6c472b5ba7130a398b'/>
<id>f7cbcb19a9ecf606172d6d6c472b5ba7130a398b</id>
<content type='text'>
The O_RESOLVE_BENEATH openat(2) flag restricts name lookups such that
they remain under the directory referenced by the dirfd.  This commit
introduces an implicit version of the flag, FD_RESOLVE_BENEATH, stored
in the file descriptor entry.  When the flag is set, any lookup relative
to that fd automatically has O_RESOLVE_BENEATH semantics.  Furthermore,
the flag is sticky, meaning that it cannot be cleared, and it is copied
by dup() and openat().

File descriptors with FD_RESOLVE_BENEATH set may not be passed to
fchdir(2) or fchroot(2).  Various fd lookup routines are modified to
return fd flags to the caller.

This flag will be used to address a case where jails with different root
directories and the ability to pass SCM_RIGHTS messages across the jail
boundary can transfer directory fds in such as way as to allow a
filesystem escape.

PR:		262180
Reviewed by:	kib
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D50371

(cherry picked from commit f35525ff2053e026a423e852136d73ed93c95803)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The O_RESOLVE_BENEATH openat(2) flag restricts name lookups such that
they remain under the directory referenced by the dirfd.  This commit
introduces an implicit version of the flag, FD_RESOLVE_BENEATH, stored
in the file descriptor entry.  When the flag is set, any lookup relative
to that fd automatically has O_RESOLVE_BENEATH semantics.  Furthermore,
the flag is sticky, meaning that it cannot be cleared, and it is copied
by dup() and openat().

File descriptors with FD_RESOLVE_BENEATH set may not be passed to
fchdir(2) or fchroot(2).  Various fd lookup routines are modified to
return fd flags to the caller.

This flag will be used to address a case where jails with different root
directories and the ability to pass SCM_RIGHTS messages across the jail
boundary can transfer directory fds in such as way as to allow a
filesystem escape.

PR:		262180
Reviewed by:	kib
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D50371

(cherry picked from commit f35525ff2053e026a423e852136d73ed93c95803)
</pre>
</div>
</content>
</entry>
<entry>
<title>compat: linux: use appropriate variables for copying out old timers</title>
<updated>2026-01-02T20:49:59+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2025-12-28T22:02:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=958f2ab6d400de5a8990c392d17eecaf2e47e6c4'/>
<id>958f2ab6d400de5a8990c392d17eecaf2e47e6c4</id>
<content type='text'>
We copyout &amp;l_oval but do the conversions into &amp;l_val, leaving us with
stack garbage.	A build with an LLVM21 cross-toolchain seems to catch
this.

Reported by:	Florian Limberger &lt;flo purplekraken com&gt;
Reviewed by:	markj
Fixes:		a1fd2911ddb06 ("linux(4): Implement timer_settime64 syscall.")
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D52985

(cherry picked from commit 541a98d7e28a8e4697ac2fa78dd4c4203c2c3a9c)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We copyout &amp;l_oval but do the conversions into &amp;l_val, leaving us with
stack garbage.	A build with an LLVM21 cross-toolchain seems to catch
this.

Reported by:	Florian Limberger &lt;flo purplekraken com&gt;
Reviewed by:	markj
Fixes:		a1fd2911ddb06 ("linux(4): Implement timer_settime64 syscall.")
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D52985

(cherry picked from commit 541a98d7e28a8e4697ac2fa78dd4c4203c2c3a9c)
</pre>
</div>
</content>
</entry>
<entry>
<title>cdefs: Add __deprecated</title>
<updated>2025-12-29T23:46:49+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2024-10-15T19:49:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9622eff37fbd62b2c5227c959973c565dbf774e6'/>
<id>9622eff37fbd62b2c5227c959973c565dbf774e6</id>
<content type='text'>
Add __deprecated decorator. This is for a deprecated interface. copystr
is tagged with this today in copy(9), but don't actually provide it or
use it. copystr is a #define so adding it will have to wait.

LinuxKPI was defining this away completely in compiler.h. Since this is
shared between Linux KPI consumers and OpenZFS, if it's already defined,
use the FreeBSD sys/cdefs.h version, otherwise define it away. For
OpenZFS this will retain it, while for Linux KPI it will tend to drop it
(I think always, but I didn't look at everything).

Sponsored by:		Netflix
Reviewed by:		jhb, emaste
Differential Revision:	https://reviews.freebsd.org/D46137

(cherry picked from commit 16672453f12586703f1c51d909bd1900691bf884)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add __deprecated decorator. This is for a deprecated interface. copystr
is tagged with this today in copy(9), but don't actually provide it or
use it. copystr is a #define so adding it will have to wait.

LinuxKPI was defining this away completely in compiler.h. Since this is
shared between Linux KPI consumers and OpenZFS, if it's already defined,
use the FreeBSD sys/cdefs.h version, otherwise define it away. For
OpenZFS this will retain it, while for Linux KPI it will tend to drop it
(I think always, but I didn't look at everything).

Sponsored by:		Netflix
Reviewed by:		jhb, emaste
Differential Revision:	https://reviews.freebsd.org/D46137

(cherry picked from commit 16672453f12586703f1c51d909bd1900691bf884)
</pre>
</div>
</content>
</entry>
<entry>
<title>LinuxKPI 802.11 / rtw88: make packets flow again</title>
<updated>2025-02-06T20:49:51+00:00</updated>
<author>
<name>Bjoern A. Zeeb</name>
<email>bz@FreeBSD.org</email>
</author>
<published>2024-12-20T14:23:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=fe6e275dc6f7527961ceaf7ce2912a29cdbb00b3'/>
<id>fe6e275dc6f7527961ceaf7ce2912a29cdbb00b3</id>
<content type='text'>
In 886653492945f we added checks for packets to only go out if the
station is known to the firmware (amongst others) as there are
implications in drivers.
Unfortunately rtw88 does not support the mac80211 (*sta_state)() KPI
but only the fallback (*sta_add/remove)() in which case the station is
only added to firmware when going from AUTH to ASSOC.  That means we
had no chance to get authenticated anymore.

PR:	283142, 274382
Fixes:	886653492945f (make sure we can send DISASSOC or DEAUTH frames)
Tested by:	imb protected-networks.net, oleg.nauman gmail.com
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48161

(cherry picked from commit 2372f8cc640c2f4ab82831e6ac0e27ab6c18321a)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In 886653492945f we added checks for packets to only go out if the
station is known to the firmware (amongst others) as there are
implications in drivers.
Unfortunately rtw88 does not support the mac80211 (*sta_state)() KPI
but only the fallback (*sta_add/remove)() in which case the station is
only added to firmware when going from AUTH to ASSOC.  That means we
had no chance to get authenticated anymore.

PR:	283142, 274382
Fixes:	886653492945f (make sure we can send DISASSOC or DEAUTH frames)
Tested by:	imb protected-networks.net, oleg.nauman gmail.com
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48161

(cherry picked from commit 2372f8cc640c2f4ab82831e6ac0e27ab6c18321a)
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix "vrefact: wrong use count 0" with DRM</title>
<updated>2025-01-17T18:47:03+00:00</updated>
<author>
<name>Edward Tomasz Napierala</name>
<email>trasz@FreeBSD.org</email>
</author>
<published>2024-11-13T10:00:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=550dede8754a1ddbf3e44894b20cb74c48111ccf'/>
<id>550dede8754a1ddbf3e44894b20cb74c48111ccf</id>
<content type='text'>
Bump the vnode use count, not its hold count. This fixes a panic triggered
by fstatat(..., AT_EMPTY_PATH) on DRM device nodes, which happens to be
what glxinfo(1) from Ubuntu Jammy is doing.

PR:		kern/274538
Reviewed By:	kib (earlier version), olce
Differential Revision:	https://reviews.freebsd.org/D47391

(cherry picked from commit fc595a6b76642dfdfdb8e6f9b9bbc734e95fb59c)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bump the vnode use count, not its hold count. This fixes a panic triggered
by fstatat(..., AT_EMPTY_PATH) on DRM device nodes, which happens to be
what glxinfo(1) from Ubuntu Jammy is doing.

PR:		kern/274538
Reviewed By:	kib (earlier version), olce
Differential Revision:	https://reviews.freebsd.org/D47391

(cherry picked from commit fc595a6b76642dfdfdb8e6f9b9bbc734e95fb59c)
</pre>
</div>
</content>
</entry>
<entry>
<title>linprocfs: Properly reset error variable for mtab generation</title>
<updated>2024-12-31T12:37:39+00:00</updated>
<author>
<name>Michael Osipov</name>
<email>michaelo@FreeBSD.org</email>
</author>
<published>2024-12-02T13:25:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3f00a0678b9de3657d859e590adb3e646aebb2ae'/>
<id>3f00a0678b9de3657d859e590adb3e646aebb2ae</id>
<content type='text'>
Both functions linprocfs_domtab() and linprocfs_doprocmountinfo() are
logically identical, but the former fails with ECANCELED because error
is not reset after the for loop.

Reviewed by:	jrm, fluffy
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D47865

(cherry picked from commit 58c7db14cd71c41f59d80d26d921782c0c27d523)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Both functions linprocfs_domtab() and linprocfs_doprocmountinfo() are
logically identical, but the former fails with ECANCELED because error
is not reset after the for loop.

Reviewed by:	jrm, fluffy
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D47865

(cherry picked from commit 58c7db14cd71c41f59d80d26d921782c0c27d523)
</pre>
</div>
</content>
</entry>
<entry>
<title>linux.h: don't redefine lower_32_bits if already defined</title>
<updated>2024-12-28T18:15:53+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2024-10-15T04:53:55+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f6222e8e816cf12d54117fb2d175738bb21f2d25'/>
<id>f6222e8e816cf12d54117fb2d175738bb21f2d25</id>
<content type='text'>
systrace.c fails to build if we're using a common compiler.h for both
openzfs and linuxkpi. The issue is easy enough to fix: don't redefined
lower_32_bits if it's already defined in linux.h, since it's the least
'standardized'. This will allow systrace.c to build using an equivalent
macro.

MFC After: 3 days
Sponsored by: Netflix

(cherry picked from commit 481d5a4891648f0a6979a48689cc16fca80d4ab6)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
systrace.c fails to build if we're using a common compiler.h for both
openzfs and linuxkpi. The issue is easy enough to fix: don't redefined
lower_32_bits if it's already defined in linux.h, since it's the least
'standardized'. This will allow systrace.c to build using an equivalent
macro.

MFC After: 3 days
Sponsored by: Netflix

(cherry picked from commit 481d5a4891648f0a6979a48689cc16fca80d4ab6)
</pre>
</div>
</content>
</entry>
<entry>
<title>linuxkpi: Provide a non-NULL value for THIS_MODULE</title>
<updated>2024-11-29T19:20:56+00:00</updated>
<author>
<name>Austin Shafer</name>
<email>ashafer@badland.io</email>
</author>
<published>2024-03-06T17:48:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=33ab06dda86a0f2a4a494c6c9908412d3373721f'/>
<id>33ab06dda86a0f2a4a494c6c9908412d3373721f</id>
<content type='text'>
THIS_MODULE is used to differentiate modules on Linux. We currently
completely stub out any Linux struct module usage, but THIS_MODULE
is still used to populate the "owner" fields of various drivers.
Even though we don't actually dereference these "owner" fields they
are still used by drivers to check if devices/dmabufs/etc come
from different modules. For example, during DRM GEM import some
drivers check if the dmabuf's owner matches the dev's owner. If
they match because they are both NULL drivers may incorrectly think
two resources come from the same module.

This adds a general purpose __this_linker_file which will point to
the linker file of the module that uses it. We can then use that
pointer to have a valid value for THIS_MODULE.

Reviewed by:	bz, jhb
Differential Revision:	https://reviews.freebsd.org/D44306

(cherry picked from commit 28a59100b54ff245a45fbd328266266f1c14eb8c)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
THIS_MODULE is used to differentiate modules on Linux. We currently
completely stub out any Linux struct module usage, but THIS_MODULE
is still used to populate the "owner" fields of various drivers.
Even though we don't actually dereference these "owner" fields they
are still used by drivers to check if devices/dmabufs/etc come
from different modules. For example, during DRM GEM import some
drivers check if the dmabuf's owner matches the dev's owner. If
they match because they are both NULL drivers may incorrectly think
two resources come from the same module.

This adds a general purpose __this_linker_file which will point to
the linker file of the module that uses it. We can then use that
pointer to have a valid value for THIS_MODULE.

Reviewed by:	bz, jhb
Differential Revision:	https://reviews.freebsd.org/D44306

(cherry picked from commit 28a59100b54ff245a45fbd328266266f1c14eb8c)
</pre>
</div>
</content>
</entry>
<entry>
<title>LinuxKPI: Remove stray semicolons</title>
<updated>2024-11-07T16:32:17+00:00</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2024-10-24T15:04:48+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ed01695d05b93a577d1ea838b443af2dfb76dd3a'/>
<id>ed01695d05b93a577d1ea838b443af2dfb76dd3a</id>
<content type='text'>
MFC after:	1 week

(cherry picked from commit b4856b8e9d872ca6ee0c4ef43e7047693ef7645b)
(cherry picked from commit 5942658cf3573bc3df9c378b688beb7549754773)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MFC after:	1 week

(cherry picked from commit b4856b8e9d872ca6ee0c4ef43e7047693ef7645b)
(cherry picked from commit 5942658cf3573bc3df9c378b688beb7549754773)
</pre>
</div>
</content>
</entry>
<entry>
<title>LinuxKPI: 802.11: support manual lladdr changes</title>
<updated>2024-09-30T12:19:05+00:00</updated>
<author>
<name>Bjoern A. Zeeb</name>
<email>bz@FreeBSD.org</email>
</author>
<published>2024-07-25T07:53:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=335a234d72be2a042e60ddd93a2644ffdc27e515'/>
<id>335a234d72be2a042e60ddd93a2644ffdc27e515</id>
<content type='text'>
Allow a user to change the "ether" address by ifconfig while a VAP is
not UP.  Compared to net80211 (given we have no callback) we register
an eventhandler per-vif (a global one would force us to use hacks to
derive if a vap is indeed also a lkpi_80211 vif).

Sponsored by:	The FreeBSD Foundation
PR:		277356
Tested by:	lwhsu
Differential Revision: https://reviews.freebsd.org/D46121

(cherry picked from commit 4aff4048f5b1b6ab0b905726853ba6083e37cc37)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allow a user to change the "ether" address by ifconfig while a VAP is
not UP.  Compared to net80211 (given we have no callback) we register
an eventhandler per-vif (a global one would force us to use hacks to
derive if a vap is indeed also a lkpi_80211 vif).

Sponsored by:	The FreeBSD Foundation
PR:		277356
Tested by:	lwhsu
Differential Revision: https://reviews.freebsd.org/D46121

(cherry picked from commit 4aff4048f5b1b6ab0b905726853ba6083e37cc37)
</pre>
</div>
</content>
</entry>
</feed>
