| #
b1326edd
|
| 28-Aug-2025 |
Olivier Certner <olce@FreeBSD.org> |
linux: setgroups16(): Pre-extend the groups array
For the size we know we will need in the end.
No functional change (intended).
MFC after: 5 days Sponsored by: The FreeBSD Foundation Diffe
linux: setgroups16(): Pre-extend the groups array
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
show more ...
|
| #
bbdea7c9
|
| 28-Aug-2025 |
Olivier Certner <olce@FreeBSD.org> |
linux: setgroups(): Fix the group number's upper limit
'ngroups_max' is the maximum number of supplementary groups the system will accept, and this has not changed.
Fixes: 9da2fe96ff2e ("k
linux: setgroups(): Fix the group number's upper limit
'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
show more ...
|
| #
a207833f
|
| 28-Aug-2025 |
Olivier Certner <olce@FreeBSD.org> |
linux: Simplify further getgroups() after 'cr_gid' not in cr_groups[]
No functional change (intended).
While here, fix/improve style a bit and in setgroups().
MFC after: 5 days MFC to:
linux: Simplify further getgroups() after 'cr_gid' not in cr_groups[]
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
show more ...
|
| #
09f2abaa
|
| 01-Aug-2025 |
Kyle Evans <kevans@FreeBSD.org> |
kern: add a new ucred flag for groups having been set
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 che
kern: add a new ucred flag for groups having been set
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
show more ...
|
| #
be1f7435
|
| 31-Jul-2025 |
Kyle Evans <kevans@FreeBSD.org> |
kern: start tracking cr_gid outside of cr_groups[]
This is the (mostly) kernel side of de-conflating cr_gid and the supplemental groups. The pre-existing behavior for getgroups() and setgroups() is
kern: start tracking cr_gid outside of cr_groups[]
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 <-> 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 &cr_groups[0] != &cr_gid.
Relnotes: yes (see last paragraph) Co-authored-by: olce Differential Revision: https://reviews.freebsd.org/D51489
show more ...
|
| #
3460fab5
|
| 18-Aug-2023 |
Dmitry Chagin <dchagin@FreeBSD.org> |
linux(4): Remove sys/cdefs.h inclusion where it's not needed due to 685dc743
|
| #
685dc743
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| #
fd745e1d
|
| 29-May-2023 |
Dmitry Chagin <dchagin@FreeBSD.org> |
linux(4): Use pwd_altroot() to tell namei() about ABI root path
PR: 72920 Differential Revision: https://reviews.freebsd.org/D40090 MFC after: 2 month
|
| #
4d846d26
|
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
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
show more ...
|
| #
d8e53d94
|
| 14-Feb-2023 |
Dmitry Chagin <dchagin@FreeBSD.org> |
linux(4): Cleanup includes under compat/linux
Cleanup unneeded includes, sort the rest according to style(9). No functional changes.
MFC after: 2 weeks
|
| #
10d16789
|
| 12-Feb-2023 |
Dmitry Chagin <dchagin@FreeBSD.org> |
linux(4): Get rid of the opt_compat.h include.
Since e013e369 COMPAT_LINUX, COMPAT_LINUX32 build options are removed, so include of opt_compat.h is no more needed.
MFC after: 2 weeks
|
| #
af4051d2
|
| 25-Nov-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
linux: remove the always curthread argument from lconvpath
|
| #
5e8caee2
|
| 05-May-2021 |
Edward Tomasz Napierala <trasz@FreeBSD.org> |
linux: remove redundant SDT tracepoints
Remove all the 'entry' and 'return' probes; they clutter up the source and are redundant to FBT.
Reviewed By: dchagin Sponsored By: EPSRC Differential Revisi
linux: remove redundant SDT tracepoints
Remove all the 'entry' and 'return' probes; they clutter up the source and are redundant to FBT.
Reviewed By: dchagin Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D30040
show more ...
|
| #
e2515283
|
| 27-Aug-2020 |
Glen Barber <gjb@FreeBSD.org> |
MFH
Sponsored by: Rubicon Communications, LLC (netgate.com)
|
| #
a125ed50
|
| 18-Aug-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
linux: add sysctl compat.linux.use_emul_path
This is a step towards facilitating jails with only Linux binaries. Supporting emul_path adds path lookups which are completely spurious if the binary at
linux: add sysctl compat.linux.use_emul_path
This is a step towards facilitating jails with only Linux binaries. Supporting emul_path adds path lookups which are completely spurious if the binary at hand runs in a Linux-based root directory.
It defaults to on (== current behavior).
make -C /root/linux-5.3-rc8 -s -j 1 bzImage:
use_emul_path=1: 101.65s user 68.68s system 100% cpu 2:49.62 total use_emul_path=0: 101.41s user 64.32s system 100% cpu 2:45.02 total
show more ...
|
| #
62375ca7
|
| 11-Aug-2019 |
Konstantin Belousov <kib@FreeBSD.org> |
compat/linux: Remove obsoleted and somewhat confusing comments related to COMPAT_43.
Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21200
|
| #
cc426dd3
|
| 11-Dec-2018 |
Mateusz Guzik <mjg@FreeBSD.org> |
Remove unused argument to priv_check_cred.
Patch mostly generated with cocinnelle:
@@ expression E1,E2; @@
- priv_check_cred(E1,E2,0) + priv_check_cred(E1,E2)
Sponsored by: The FreeBSD Foundation
|
| #
b1326edd
|
| 28-Aug-2025 |
Olivier Certner <olce@FreeBSD.org> |
linux: setgroups16(): Pre-extend the groups array
For the size we know we will need in the end.
No functional change (intended).
MFC after: 5 days Sponsored by: The FreeBSD Foundation Diffe
linux: setgroups16(): Pre-extend the groups array
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
show more ...
|
| #
bbdea7c9
|
| 28-Aug-2025 |
Olivier Certner <olce@FreeBSD.org> |
linux: setgroups(): Fix the group number's upper limit
'ngroups_max' is the maximum number of supplementary groups the system will accept, and this has not changed.
Fixes: 9da2fe96ff2e ("k
linux: setgroups(): Fix the group number's upper limit
'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
show more ...
|
| #
a207833f
|
| 28-Aug-2025 |
Olivier Certner <olce@FreeBSD.org> |
linux: Simplify further getgroups() after 'cr_gid' not in cr_groups[]
No functional change (intended).
While here, fix/improve style a bit and in setgroups().
MFC after: 5 days MFC to:
linux: Simplify further getgroups() after 'cr_gid' not in cr_groups[]
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
show more ...
|
| #
09f2abaa
|
| 01-Aug-2025 |
Kyle Evans <kevans@FreeBSD.org> |
kern: add a new ucred flag for groups having been set
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 che
kern: add a new ucred flag for groups having been set
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
show more ...
|
| #
be1f7435
|
| 31-Jul-2025 |
Kyle Evans <kevans@FreeBSD.org> |
kern: start tracking cr_gid outside of cr_groups[]
This is the (mostly) kernel side of de-conflating cr_gid and the supplemental groups. The pre-existing behavior for getgroups() and setgroups() is
kern: start tracking cr_gid outside of cr_groups[]
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 <-> 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 &cr_groups[0] != &cr_gid.
Relnotes: yes (see last paragraph) Co-authored-by: olce Differential Revision: https://reviews.freebsd.org/D51489
show more ...
|
| #
3460fab5
|
| 18-Aug-2023 |
Dmitry Chagin <dchagin@FreeBSD.org> |
linux(4): Remove sys/cdefs.h inclusion where it's not needed due to 685dc743
|
| #
685dc743
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| #
fd745e1d
|
| 29-May-2023 |
Dmitry Chagin <dchagin@FreeBSD.org> |
linux(4): Use pwd_altroot() to tell namei() about ABI root path
PR: 72920 Differential Revision: https://reviews.freebsd.org/D40090 MFC after: 2 month
|