<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/compat/linux/linux_uid16.c, branch releng/15.0</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>linux: setgroups16(): Pre-extend the groups array</title>
<updated>2025-09-23T12:02:45+00:00</updated>
<author>
<name>Olivier Certner</name>
<email>olce@FreeBSD.org</email>
</author>
<published>2025-08-28T16:27:30+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=db27bce904befe71052372545e6e111075dcc801'/>
<id>db27bce904befe71052372545e6e111075dcc801</id>
<content type='text'>
For the size we know we will need in the end.

No functional change (intended).

MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52279

(cherry picked from commit b1326edddb302a28fc9418ab60df6210513cc07c)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For the size we know we will need in the end.

No functional change (intended).

MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52279

(cherry picked from commit b1326edddb302a28fc9418ab60df6210513cc07c)
</pre>
</div>
</content>
</entry>
<entry>
<title>linux: setgroups(): Fix the group number's upper limit</title>
<updated>2025-09-23T12:02:44+00:00</updated>
<author>
<name>Olivier Certner</name>
<email>olce@FreeBSD.org</email>
</author>
<published>2025-08-28T16:58:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=469c3a4139fe85b092734b0af9dbc167a8ebbf1e'/>
<id>469c3a4139fe85b092734b0af9dbc167a8ebbf1e</id>
<content type='text'>
'ngroups_max' is the maximum number of supplementary groups the system
will accept, and this has not changed.

Fixes:          9da2fe96ff2e ("kern: fix setgroups(2) and getgroups(2) to match other platforms")
MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52277

(cherry picked from commit bbdea7c9f4aeae26b35f842382df0203fcda24a5)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
'ngroups_max' is the maximum number of supplementary groups the system
will accept, and this has not changed.

Fixes:          9da2fe96ff2e ("kern: fix setgroups(2) and getgroups(2) to match other platforms")
MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52277

(cherry picked from commit bbdea7c9f4aeae26b35f842382df0203fcda24a5)
</pre>
</div>
</content>
</entry>
<entry>
<title>linux: Simplify further getgroups() after 'cr_gid' not in cr_groups[]</title>
<updated>2025-09-23T12:02:44+00:00</updated>
<author>
<name>Olivier Certner</name>
<email>olce@FreeBSD.org</email>
</author>
<published>2025-08-28T15:29:33+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=8013a7137d3ac5d6f0f3386fe8531594bcb067be'/>
<id>8013a7137d3ac5d6f0f3386fe8531594bcb067be</id>
<content type='text'>
No functional change (intended).

While here, fix/improve style a bit and in setgroups().

MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52276

(cherry picked from commit a207833f4fed5431cac853c082fa34dc8f33cba6)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No functional change (intended).

While here, fix/improve style a bit and in setgroups().

MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52276

(cherry picked from commit a207833f4fed5431cac853c082fa34dc8f33cba6)
</pre>
</div>
</content>
</entry>
<entry>
<title>kern: add a new ucred flag for groups having been set</title>
<updated>2025-08-01T00:50:47+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2025-08-01T00:50:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=09f2abaa59f948e2d21604b5e528a264a6d8c329'/>
<id>09f2abaa59f948e2d21604b5e528a264a6d8c329</id>
<content type='text'>
Now that we can legitimately have ngroups == 0 as a result of calling
crsetgroups(), set a flag when we've set groups for the sake of sanity
checking usage of crextend().  While it's true this flag will only
really be used under INVARIANTS, it's only the second flag bit that
we're adding in 16 years.

Reviewed by:	olce
Differential Revision:	https://reviews.freebsd.org/D51646
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that we can legitimately have ngroups == 0 as a result of calling
crsetgroups(), set a flag when we've set groups for the sake of sanity
checking usage of crextend().  While it's true this flag will only
really be used under INVARIANTS, it's only the second flag bit that
we're adding in 16 years.

Reviewed by:	olce
Differential Revision:	https://reviews.freebsd.org/D51646
</pre>
</div>
</content>
</entry>
<entry>
<title>kern: start tracking cr_gid outside of cr_groups[]</title>
<updated>2025-07-31T04:44:11+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2025-07-31T04:44:11+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=be1f7435ef218b1df35aebf3b90dd65ffd8bbe51'/>
<id>be1f7435ef218b1df35aebf3b90dd65ffd8bbe51</id>
<content type='text'>
This is the (mostly) kernel side of de-conflating cr_gid and the
supplemental groups.  The pre-existing behavior for getgroups() and
setgroups() is retained to keep the user &lt;-&gt; kernel boundary
functionally the same while we audit use of these syscalls, but we can
remove a lot of the internal special-casing just by reorganizing ucred
like this.

struct xucred has been altered because the cr_gid macro becomes
problematic if ucred has a real cr_gid member but xucred does not.  Most
notably, they both also have cr_groups[] members, so the definition
means that we could easily have situations where we end up using the
first supplemental group as the egid in some places.  We really can't
change the ABI of xucred, so instead we alias the first member to the
`cr_gid` name and maintain the status quo.

This also fixes the Linux setgroups(2)/getgroups(2) implementation to
more cleanly preserve the group set, now that we don't need to special
case cr_groups[0].

__FreeBSD_version bumped for the `struct ucred` ABI break.

For relnotes: downstreams and out-of-tree modules absolutely must fix
any references to cr_groups[0] in their code.  These are almost
exclusively incorrect in the new world, and cr_gid should be used
instead.  There is a cr_gid macro available in earlier FreeBSD versions
that can be used to avoid having version-dependant conditionals to refer
to the effective group id.  Surrounding code may need adjusted if it
peels off the first element of cr_groups and uses the others as the
supplemental groups, since the supplemental groups start at cr_groups[0]
now if &amp;cr_groups[0] != &amp;cr_gid.

Relnotes:	yes (see last paragraph)
Co-authored-by:	olce
Differential Revision:	https://reviews.freebsd.org/D51489
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the (mostly) kernel side of de-conflating cr_gid and the
supplemental groups.  The pre-existing behavior for getgroups() and
setgroups() is retained to keep the user &lt;-&gt; kernel boundary
functionally the same while we audit use of these syscalls, but we can
remove a lot of the internal special-casing just by reorganizing ucred
like this.

struct xucred has been altered because the cr_gid macro becomes
problematic if ucred has a real cr_gid member but xucred does not.  Most
notably, they both also have cr_groups[] members, so the definition
means that we could easily have situations where we end up using the
first supplemental group as the egid in some places.  We really can't
change the ABI of xucred, so instead we alias the first member to the
`cr_gid` name and maintain the status quo.

This also fixes the Linux setgroups(2)/getgroups(2) implementation to
more cleanly preserve the group set, now that we don't need to special
case cr_groups[0].

__FreeBSD_version bumped for the `struct ucred` ABI break.

For relnotes: downstreams and out-of-tree modules absolutely must fix
any references to cr_groups[0] in their code.  These are almost
exclusively incorrect in the new world, and cr_gid should be used
instead.  There is a cr_gid macro available in earlier FreeBSD versions
that can be used to avoid having version-dependant conditionals to refer
to the effective group id.  Surrounding code may need adjusted if it
peels off the first element of cr_groups and uses the others as the
supplemental groups, since the supplemental groups start at cr_groups[0]
now if &amp;cr_groups[0] != &amp;cr_gid.

Relnotes:	yes (see last paragraph)
Co-authored-by:	olce
Differential Revision:	https://reviews.freebsd.org/D51489
</pre>
</div>
</content>
</entry>
<entry>
<title>linux(4): Remove sys/cdefs.h inclusion where it's not needed due to 685dc743</title>
<updated>2023-08-18T10:12:02+00:00</updated>
<author>
<name>Dmitry Chagin</name>
<email>dchagin@FreeBSD.org</email>
</author>
<published>2023-08-18T10:12:02+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3460fab5fced39c7ea597cc7de0ebc3e4c88989a'/>
<id>3460fab5fced39c7ea597cc7de0ebc3e4c88989a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-16T17:54:36+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=685dc743dc3b5645e34836464128e1c0558b404b'/>
<id>685dc743dc3b5645e34836464128e1c0558b404b</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>linux(4): Use pwd_altroot() to tell namei() about ABI root path</title>
<updated>2023-05-29T08:16:46+00:00</updated>
<author>
<name>Dmitry Chagin</name>
<email>dchagin@FreeBSD.org</email>
</author>
<published>2023-05-29T08:16:46+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=fd745e1db6b561900b8e5e9caa4ed05cf15398b3'/>
<id>fd745e1db6b561900b8e5e9caa4ed05cf15398b3</id>
<content type='text'>
PR:			72920
Differential Revision:	https://reviews.freebsd.org/D40090
MFC after:		2 month
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR:			72920
Differential Revision:	https://reviews.freebsd.org/D40090
MFC after:		2 month
</pre>
</div>
</content>
</entry>
<entry>
<title>spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD</title>
<updated>2023-05-12T16:44:03+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-05-10T15:40:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4d846d260e2b9a3d4d0a701462568268cbfe7a5b'/>
<id>4d846d260e2b9a3d4d0a701462568268cbfe7a5b</id>
<content type='text'>
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
</pre>
</div>
</content>
</entry>
<entry>
<title>linux(4): Cleanup includes under compat/linux</title>
<updated>2023-02-14T14:46:32+00:00</updated>
<author>
<name>Dmitry Chagin</name>
<email>dchagin@FreeBSD.org</email>
</author>
<published>2023-02-14T14:46:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d8e53d94fae90cf3c83db5af0eaba0be0f55e00a'/>
<id>d8e53d94fae90cf3c83db5af0eaba0be0f55e00a</id>
<content type='text'>
Cleanup unneeded includes, sort the rest according to style(9).
No functional changes.

MFC after:		2 weeks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Cleanup unneeded includes, sort the rest according to style(9).
No functional changes.

MFC after:		2 weeks
</pre>
</div>
</content>
</entry>
</feed>
