<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libc/sys, 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>stat(2): Document the st_rdev field</title>
<updated>2025-08-27T18:50:58+00:00</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2025-08-17T17:07:55+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=0d9522888c0d37f11b3b9af0595d6dc7e0982ef2'/>
<id>0d9522888c0d37f11b3b9af0595d6dc7e0982ef2</id>
<content type='text'>
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	bcr
Differential Revision:	https://reviews.freebsd.org/D51946

(cherry picked from commit 4eaa7f66620c33957ff9a929820cb791f7fe5578)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	bcr
Differential Revision:	https://reviews.freebsd.org/D51946

(cherry picked from commit 4eaa7f66620c33957ff9a929820cb791f7fe5578)
</pre>
</div>
</content>
</entry>
<entry>
<title>Canonicalize the name of the FreeBSD Foundation</title>
<updated>2025-02-19T19:52:36+00:00</updated>
<author>
<name>Li-Wen Hsu</name>
<email>lwhsu@FreeBSD.org</email>
</author>
<published>2024-10-23T21:03:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=fd3016b17efbfb351c62921e4ec1ac3812baffab'/>
<id>fd3016b17efbfb351c62921e4ec1ac3812baffab</id>
<content type='text'>
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit dab59af3bcc7cb7ba01569d3044894b3e860ad56)
(cherry picked from commit ef3ed0726f2230e38df76a32a3b9ff145147af65)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit dab59af3bcc7cb7ba01569d3044894b3e860ad56)
(cherry picked from commit ef3ed0726f2230e38df76a32a3b9ff145147af65)
</pre>
</div>
</content>
</entry>
<entry>
<title>munmap.2: Remove EINVAL for negative len</title>
<updated>2025-01-20T14:30:43+00:00</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2025-01-15T21:44:31+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=8883e8de05598e475d2ac129dfefd734e06908ab'/>
<id>8883e8de05598e475d2ac129dfefd734e06908ab</id>
<content type='text'>
len is unsigned (it is size_t), so cannot be negative.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit fab411c4fd5224e3dd44e0eb288d60b27480e2d1)
(cherry picked from commit e2cbfa1f5045019d34eb0091db7755c151ea06d5)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
len is unsigned (it is size_t), so cannot be negative.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit fab411c4fd5224e3dd44e0eb288d60b27480e2d1)
(cherry picked from commit e2cbfa1f5045019d34eb0091db7755c151ea06d5)
</pre>
</div>
</content>
</entry>
<entry>
<title>munmap.2: Unaligned addresses do not return error</title>
<updated>2025-01-20T14:30:43+00:00</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2025-01-15T16:52:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=a52b922c05a46f594fa604e1af3f17f046aba955'/>
<id>a52b922c05a46f594fa604e1af3f17f046aba955</id>
<content type='text'>
We previously claimed that non-page-aligned addresses would return
EINVAL, but the address is in fact rounded down to the page boundary.

Reported by:	Harald Eilertsen &lt;haraldei@anduin.net&gt;
Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Fixes: dabee6fecc67 ("kern_descrip.c: add fdshare()/fdcopy()")
Differential Revision: https://reviews.freebsd.org/D48465

(cherry picked from commit 9e36aaf0c24cf158e83c69c1d2312c000c3c36f3)
(cherry picked from commit 61c50909354ace6f07d0b2113f10965f4546e0ed)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We previously claimed that non-page-aligned addresses would return
EINVAL, but the address is in fact rounded down to the page boundary.

Reported by:	Harald Eilertsen &lt;haraldei@anduin.net&gt;
Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Fixes: dabee6fecc67 ("kern_descrip.c: add fdshare()/fdcopy()")
Differential Revision: https://reviews.freebsd.org/D48465

(cherry picked from commit 9e36aaf0c24cf158e83c69c1d2312c000c3c36f3)
(cherry picked from commit 61c50909354ace6f07d0b2113f10965f4546e0ed)
</pre>
</div>
</content>
</entry>
<entry>
<title>procctl.2: Editing pass</title>
<updated>2024-12-27T15:47:25+00:00</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2024-12-04T14:11:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=269e5e7dcbe494beeb2c96badd04737dbfaec0a7'/>
<id>269e5e7dcbe494beeb2c96badd04737dbfaec0a7</id>
<content type='text'>
- Add some missing .Pp macros after the end of literal blocks and some
  lists to ensure there is a blank line before the following text.

- Use an indent of Ds for nested lists to reduce excessive indentation and
  make the bodies of the nested list items easier to read.

- Various and sundry rewordings and clarifications.

Reviewed by:	kib, emaste
Differential Revision:	https://reviews.freebsd.org/D47782

(cherry picked from commit 8277c790179304159c2e4dcb1d99552518d5be8e)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Add some missing .Pp macros after the end of literal blocks and some
  lists to ensure there is a blank line before the following text.

- Use an indent of Ds for nested lists to reduce excessive indentation and
  make the bodies of the nested list items easier to read.

- Various and sundry rewordings and clarifications.

Reviewed by:	kib, emaste
Differential Revision:	https://reviews.freebsd.org/D47782

(cherry picked from commit 8277c790179304159c2e4dcb1d99552518d5be8e)
</pre>
</div>
</content>
</entry>
<entry>
<title>manuals: Misc macro typos</title>
<updated>2024-12-27T15:47:13+00:00</updated>
<author>
<name>Graham Percival</name>
<email>gperciva@tarsnap.com</email>
</author>
<published>2024-09-12T16:36:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=0d17ac9c22028eee7121b25a7039ecec7dbc47f0'/>
<id>0d17ac9c22028eee7121b25a7039ecec7dbc47f0</id>
<content type='text'>
These were reported by `mandoc -T lint` as
    ERROR: skipping unknown macro
When these pages were rendered with `man`, the "unknown macro" meant
that the entire line was omitted from the output.

Obvious typos in:
lib/libsys/swapon.2
lib/libsys/procctl.2
share/man/man9/firmware.9

lib/libcasper/services/cap_net/cap_net.3: 'mode' describes a function
    argument.

lib/libsys/statfs.2: there's no .Tm command ("trademark?"), and
    .Tn ("tradename") is deprecated, so remove the macro entirely.

usr.sbin/mfiutil/mfiutil.8: man was interpreting '/dev/' as a macro
    (which it didn't recognize).

share/man/man4/qat.4: same issue as above, but with '0'.  In this case,
    given the context of the previous line, rewriting as "Value '0'"
    seemed more appropriate.

usr.sbin/mlx5tool/mlx5tool.8: typo in .Xr

Signed-off-by:	Graham Percival &lt;gperciva@tarsnap.com&gt;
Sponsored by:	Tarsnap Backup Inc.
Reviewed by:	concussious, imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1417

(cherry picked from commit 2878d99dfcfbdd7a415a7f31cf95fbd53fc8e581)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These were reported by `mandoc -T lint` as
    ERROR: skipping unknown macro
When these pages were rendered with `man`, the "unknown macro" meant
that the entire line was omitted from the output.

Obvious typos in:
lib/libsys/swapon.2
lib/libsys/procctl.2
share/man/man9/firmware.9

lib/libcasper/services/cap_net/cap_net.3: 'mode' describes a function
    argument.

lib/libsys/statfs.2: there's no .Tm command ("trademark?"), and
    .Tn ("tradename") is deprecated, so remove the macro entirely.

usr.sbin/mfiutil/mfiutil.8: man was interpreting '/dev/' as a macro
    (which it didn't recognize).

share/man/man4/qat.4: same issue as above, but with '0'.  In this case,
    given the context of the previous line, rewriting as "Value '0'"
    seemed more appropriate.

usr.sbin/mlx5tool/mlx5tool.8: typo in .Xr

Signed-off-by:	Graham Percival &lt;gperciva@tarsnap.com&gt;
Sponsored by:	Tarsnap Backup Inc.
Reviewed by:	concussious, imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1417

(cherry picked from commit 2878d99dfcfbdd7a415a7f31cf95fbd53fc8e581)
</pre>
</div>
</content>
</entry>
<entry>
<title>manuals: Fix errors in .2 pages</title>
<updated>2024-12-27T15:46:45+00:00</updated>
<author>
<name>Graham Percival</name>
<email>gperciva@tarsnap.com</email>
</author>
<published>2024-09-20T01:54:39+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3aaa2a2694cd26a1706c42465d8a3c96ffd68013'/>
<id>3aaa2a2694cd26a1706c42465d8a3c96ffd68013</id>
<content type='text'>
These were reported by `mandoc -T lint ...` as errors.

fhlink.2, fhreadlink.2: remove unneeded block closing.

getfh.2, procctl.2: add necessary block closing.

ptrace.2: -width only takes one argument.

swapon.2: &lt;sys/vmparam.h&gt; and &lt;vm/swap_pager.h&gt; weren't being displayed,
    because .It is for a list item whereas .In is for included files.
    Also, we want a blank line between &lt;sys/ &gt; headers and the other
    one.

Signed-off-by:	Graham Percival &lt;gperciva@tarsnap.com&gt;
PR:		281597
Reviewed by:	mhorne
Sponsored by:	Tarsnap Backup Inc.

(cherry picked from commit 650056363baddb83c61c85b0539ee536f3d4b56c)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These were reported by `mandoc -T lint ...` as errors.

fhlink.2, fhreadlink.2: remove unneeded block closing.

getfh.2, procctl.2: add necessary block closing.

ptrace.2: -width only takes one argument.

swapon.2: &lt;sys/vmparam.h&gt; and &lt;vm/swap_pager.h&gt; weren't being displayed,
    because .It is for a list item whereas .In is for included files.
    Also, we want a blank line between &lt;sys/ &gt; headers and the other
    one.

Signed-off-by:	Graham Percival &lt;gperciva@tarsnap.com&gt;
PR:		281597
Reviewed by:	mhorne
Sponsored by:	Tarsnap Backup Inc.

(cherry picked from commit 650056363baddb83c61c85b0539ee536f3d4b56c)
</pre>
</div>
</content>
</entry>
<entry>
<title>access(2): Discourage use of these system calls.</title>
<updated>2024-05-23T02:43:49+00:00</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2024-05-21T22:35:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=55cd52a4418d79962ebd81f34544a3747db9e031'/>
<id>55cd52a4418d79962ebd81f34544a3747db9e031</id>
<content type='text'>
Fixes:		421025a274fb
PR:		262895
MFC after:	3 days
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D45240

(cherry picked from commit a4be1eb21165d7aedae9dc6634528619ff10d025)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes:		421025a274fb
PR:		262895
MFC after:	3 days
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D45240

(cherry picked from commit a4be1eb21165d7aedae9dc6634528619ff10d025)
</pre>
</div>
</content>
</entry>
<entry>
<title>access.2: Mention that lstat(2) should be used for symbolic links</title>
<updated>2024-05-23T02:43:49+00:00</updated>
<author>
<name>Gordon Bergling</name>
<email>gbe@FreeBSD.org</email>
</author>
<published>2024-05-13T08:40:12+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=78ea1fcf29a780fb6bd90e41772d5a3751fb56d7'/>
<id>78ea1fcf29a780fb6bd90e41772d5a3751fb56d7</id>
<content type='text'>
access(), eaccess() and faccessat() will always dereference
symbolic links.

So add a note in the manual page, that lstat(2) should be
used in the case of symbolic links.

PR:	262895
Reviewed by:	gbe, pauamma_gundo.com
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44890

(cherry picked from commit 421025a274fb5759b3ecc8bdb30b24db830b45ae)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
access(), eaccess() and faccessat() will always dereference
symbolic links.

So add a note in the manual page, that lstat(2) should be
used in the case of symbolic links.

PR:	262895
Reviewed by:	gbe, pauamma_gundo.com
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44890

(cherry picked from commit 421025a274fb5759b3ecc8bdb30b24db830b45ae)
</pre>
</div>
</content>
</entry>
</feed>
