<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/security, branch stable/14</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>audit: Replace TAILQ with STAILQ</title>
<updated>2026-06-16T01:00:21+00:00</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-06-05T21:50:46+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9b30dccaefeac13f149fe942cf9d94d2ff0c86e5'/>
<id>9b30dccaefeac13f149fe942cf9d94d2ff0c86e5</id>
<content type='text'>
This reduces the size of a trigger entry from 24 bytes to 16 (or from
12 bytes to 8 on 32-bit) with no additional complexity.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, emaste
Differential Revision:	https://reviews.freebsd.org/D57464

(cherry picked from commit 77e894cb09affe828f4bc81b8e4751a7e22860de)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reduces the size of a trigger entry from 24 bytes to 16 (or from
12 bytes to 8 on 32-bit) with no additional complexity.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, emaste
Differential Revision:	https://reviews.freebsd.org/D57464

(cherry picked from commit 77e894cb09affe828f4bc81b8e4751a7e22860de)
</pre>
</div>
</content>
</entry>
<entry>
<title>audit: Add poll / select support</title>
<updated>2026-06-16T01:00:21+00:00</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-06-05T21:50:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5ecad824383041655ca95c0628c709d6573a7150'/>
<id>5ecad824383041655ca95c0628c709d6573a7150</id>
<content type='text'>
It was previously not possible to poll() or select() on the trigger
device, which made implementing proper signal handling in auditd
difficult.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, markj
Differential Revision:	https://reviews.freebsd.org/D57457

(cherry picked from commit 0620c99d278b6a2fd6fe995f5bb365158e04ad7c)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It was previously not possible to poll() or select() on the trigger
device, which made implementing proper signal handling in auditd
difficult.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, markj
Differential Revision:	https://reviews.freebsd.org/D57457

(cherry picked from commit 0620c99d278b6a2fd6fe995f5bb365158e04ad7c)
</pre>
</div>
</content>
</entry>
<entry>
<title>mac_seeotheruids: allow specificgid to be a list of groups</title>
<updated>2026-04-29T04:19:58+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2026-03-01T03:42:25+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=14dfca710fd06d02b4a1cfa25e080b7d90d802dc'/>
<id>14dfca710fd06d02b4a1cfa25e080b7d90d802dc</id>
<content type='text'>
The specificgid functionality has historically allowed only a single
group to be exempt, but in practice one might want a few services to
be exempt for reasons.  From a security perspective, we probably don't
want to encourage unrelated users to be grouped together solely for
this purpose, as that creates one point of shared access that could be
used for nefarious purposes.

Normalize the group list as we do cr_groups to allow for linear matching
rather than quadratic, we just need to account for the differences in
FreeBSD 15.0+ where cr_groups is entirely supplementary groups vs.
earlier versions, where cr_groups[0] is the egid and the rest is
sorted.

Reviewed by:	csjp, des (earlier version)
Sponsored by:	Klara, Inc.

(cherry picked from commit b675ff8eedc9ac93cdf1cfe33185b7a1a027df37)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The specificgid functionality has historically allowed only a single
group to be exempt, but in practice one might want a few services to
be exempt for reasons.  From a security perspective, we probably don't
want to encourage unrelated users to be grouped together solely for
this purpose, as that creates one point of shared access that could be
used for nefarious purposes.

Normalize the group list as we do cr_groups to allow for linear matching
rather than quadratic, we just need to account for the differences in
FreeBSD 15.0+ where cr_groups is entirely supplementary groups vs.
earlier versions, where cr_groups[0] is the egid and the rest is
sorted.

Reviewed by:	csjp, des (earlier version)
Sponsored by:	Klara, Inc.

(cherry picked from commit b675ff8eedc9ac93cdf1cfe33185b7a1a027df37)
</pre>
</div>
</content>
</entry>
<entry>
<title>MAC: Use proper prototype for SYSINIT functions</title>
<updated>2026-01-31T18:25:05+00:00</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2025-10-13T10:12:35+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=bddd70611a0fceb6a89acaa7955cb46755107a33'/>
<id>bddd70611a0fceb6a89acaa7955cb46755107a33</id>
<content type='text'>
MFC after:	1 week

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

(cherry picked from commit 12ac59a0d1f6ae2065e8e2cb36c53c00771bfc74)
(cherry picked from commit 2e5a55c7af56022fb38e3d528b2e8b1257de891d)
</pre>
</div>
</content>
</entry>
<entry>
<title>audit: Use proper prototype for SYSINIT functions</title>
<updated>2026-01-31T18:25:05+00:00</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2025-10-13T10:12:34+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=139a9451b9105cad9ccb0b8e4eda91d9cbc40b69'/>
<id>139a9451b9105cad9ccb0b8e4eda91d9cbc40b69</id>
<content type='text'>
MFC after:	1 week

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

(cherry picked from commit 32c1e940e07c48ab80427efd3d6ff2091407d577)
(cherry picked from commit c48a31e3508555606b4399d33000cf60fe98e207)
</pre>
</div>
</content>
</entry>
<entry>
<title>MAC: Use the current thread's user ABI to determine the layout of struct mac</title>
<updated>2026-01-29T15:28:48+00:00</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2025-11-24T15:47:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7a1a4f10a64d51f877422da6d4833cc4e2a95265'/>
<id>7a1a4f10a64d51f877422da6d4833cc4e2a95265</id>
<content type='text'>
This removes mac_label_copyin32() as mac_label_copyin() can now handle
both native and 32-bit struct mac objects.

Reviewed by:	olce, brooks
Obtained from:	CheriBSD
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D53755

(cherry picked from commit 134d00bd2c910cc7cc21c11fba093ff82bbb9344)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This removes mac_label_copyin32() as mac_label_copyin() can now handle
both native and 32-bit struct mac objects.

Reviewed by:	olce, brooks
Obtained from:	CheriBSD
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D53755

(cherry picked from commit 134d00bd2c910cc7cc21c11fba093ff82bbb9344)
</pre>
</div>
</content>
</entry>
<entry>
<title>mac_ipacl: Use IfAPI</title>
<updated>2025-12-26T08:25:47+00:00</updated>
<author>
<name>Justin Hibbits</name>
<email>jhibbits@FreeBSD.org</email>
</author>
<published>2023-08-25T16:44:17+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=bcd1e5fb540ffed26b25f520a69e092423f8ccaa'/>
<id>bcd1e5fb540ffed26b25f520a69e092423f8ccaa</id>
<content type='text'>
Use `if_t` instead of `struct ifnet *`, and if_name() accessor.

Sponsored by:	Juniper Networks, Inc.

(cherry picked from commit b820820ece099a73511d7daec407d78f38185a9b)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use `if_t` instead of `struct ifnet *`, and if_name() accessor.

Sponsored by:	Juniper Networks, Inc.

(cherry picked from commit b820820ece099a73511d7daec407d78f38185a9b)
</pre>
</div>
</content>
</entry>
<entry>
<title>kern: adopt the cr_gid macro for cr_groups[0] more widely</title>
<updated>2025-12-19T09:16:43+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2025-07-24T14:59:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ed39e2b3cf429dc34cd27c1fa09a39db9451ea78'/>
<id>ed39e2b3cf429dc34cd27c1fa09a39db9451ea78</id>
<content type='text'>
A future change may split cr_gid out of cr_groups[0] so that there's a
cleaner separation between the supplemental groups and the effective
group.  Do the mechanical conversion where we can, and drop some
comments where we need further work because some assumptions about
cr_gid == cr_groups[0] have been made.

This should not be a functional change, but downstreams and other
out-of-tree code are advised to investigate their usage of cr_groups
sooner rather than later, as a future change will render assumptions
about these two being equivalent harmful.

Reviewed by:	asomers, kib, olce
Differential Revision:	https://reviews.freebsd.org/D51153

(cherry picked from commit 46c07316f90628a82dd461376ccff64a81254325)

This was MFCed to ease application of further commits.

NOTE: Downstreams and out-of-tree code targeting stable/14 need not do
the switch, as splitting 'cr_gid' out of cr_groups[], as we did in
stable/15 (and is in 15.0), is not on the agenda for stable/14.

Comments that were added temporarily for stable/15, alluding to the
future split, have been removed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A future change may split cr_gid out of cr_groups[0] so that there's a
cleaner separation between the supplemental groups and the effective
group.  Do the mechanical conversion where we can, and drop some
comments where we need further work because some assumptions about
cr_gid == cr_groups[0] have been made.

This should not be a functional change, but downstreams and other
out-of-tree code are advised to investigate their usage of cr_groups
sooner rather than later, as a future change will render assumptions
about these two being equivalent harmful.

Reviewed by:	asomers, kib, olce
Differential Revision:	https://reviews.freebsd.org/D51153

(cherry picked from commit 46c07316f90628a82dd461376ccff64a81254325)

This was MFCed to ease application of further commits.

NOTE: Downstreams and out-of-tree code targeting stable/14 need not do
the switch, as splitting 'cr_gid' out of cr_groups[], as we did in
stable/15 (and is in 15.0), is not on the agenda for stable/14.

Comments that were added temporarily for stable/15, alluding to the
future split, have been removed.
</pre>
</div>
</content>
</entry>
<entry>
<title>audit(4): Fix a typo in an kernel error message</title>
<updated>2025-11-19T11:17:32+00:00</updated>
<author>
<name>Gordon Bergling</name>
<email>gbe@FreeBSD.org</email>
</author>
<published>2025-10-29T15:05:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=1a1eae617d3f3bf9e2bb48519d9f5abe204ba727'/>
<id>1a1eae617d3f3bf9e2bb48519d9f5abe204ba727</id>
<content type='text'>
- s/Authenticateion/Authentication/

(cherry picked from commit 63af953e09ccd11f2f5b4d83b10cc231f691de46)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- s/Authenticateion/Authentication/

(cherry picked from commit 63af953e09ccd11f2f5b4d83b10cc231f691de46)
</pre>
</div>
</content>
</entry>
<entry>
<title>MAC/do: Check executable path from the current jail's root</title>
<updated>2025-10-10T17:16:00+00:00</updated>
<author>
<name>Olivier Certner</name>
<email>olce@FreeBSD.org</email>
</author>
<published>2025-09-27T09:56:33+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b025aa9f5abc44a19a6437bea17fcc80a7747200'/>
<id>b025aa9f5abc44a19a6437bea17fcc80a7747200</id>
<content type='text'>
Contrary to my initial belief, vn_fullpath() does return a vnode's path
from the current chroot, and not from the global root (which would have
been a bug also, but without security consequences).  This enables
a "confused deputy"-like scenario where a chroot(2) can change which
executable can be authorized by MAC/do, which is even more problematic
for unprivileged chroot(2).

This was found by re-examining the code following two close events:
1. Shawn Webb sent a mail to freebsd-hackers@ on 08/05 saying that in
   HardenedBSD they had added a check on P2_NO_NEW_PRIVS (in
   mac_do_priv_grant()), which I responded to on 08/20 saying that
   P2_NO_NEW_PRIVS was not necessary for mac_do(4), with a correct
   reasoning but based on the wrong above-mentioned assumption about
   vn_fullpath().
2. I reviewed some code by Kushagra Srivastava (GSoC 2025 student
   working on mac_do(4)/mdo(1)) adding the ability to specify which
   executables can spawn processes that mac_do(4) may decide to
   authorize (others are simply ignored), which currently is hardcoded
   to '/usr/bin/mdo'.

MFC after:      3 days
Event:          EuroBSDCon 2025
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52758

(cherry picked from commit 9f269a0a771aff4f0a735211907a52c52fc0661b)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Contrary to my initial belief, vn_fullpath() does return a vnode's path
from the current chroot, and not from the global root (which would have
been a bug also, but without security consequences).  This enables
a "confused deputy"-like scenario where a chroot(2) can change which
executable can be authorized by MAC/do, which is even more problematic
for unprivileged chroot(2).

This was found by re-examining the code following two close events:
1. Shawn Webb sent a mail to freebsd-hackers@ on 08/05 saying that in
   HardenedBSD they had added a check on P2_NO_NEW_PRIVS (in
   mac_do_priv_grant()), which I responded to on 08/20 saying that
   P2_NO_NEW_PRIVS was not necessary for mac_do(4), with a correct
   reasoning but based on the wrong above-mentioned assumption about
   vn_fullpath().
2. I reviewed some code by Kushagra Srivastava (GSoC 2025 student
   working on mac_do(4)/mdo(1)) adding the ability to specify which
   executables can spawn processes that mac_do(4) may decide to
   authorize (others are simply ignored), which currently is hardcoded
   to '/usr/bin/mdo'.

MFC after:      3 days
Event:          EuroBSDCon 2025
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52758

(cherry picked from commit 9f269a0a771aff4f0a735211907a52c52fc0661b)
</pre>
</div>
</content>
</entry>
</feed>
