opnsense-src/lib
Olivier Certner f9fa6cb391
cred: Hide internal flag CRED_FLAG_CAPMODE
This flag is used in field 'cr_flags', which is never directly visible
outside the kernel.  That field is however exported through 'struct
kinfo_proc' objects (field 'ki_cr_flags'), either from the kernel via
sysctls or from libkvm, and is supposed to contain exported flags
prefixed with KI_CRF_ (currently, KI_CRF_CAPABILITY_MODE and
KI_CRF_GRP_OVERFLOW, this second one being a purely userland one
signaling overflow of 'ki_groups').

Make sure that KI_CRF_CAPABILITY_MODE is the flag actually exported and
tested by userland programs, and hide the internal CRED_FLAG_CAPMODE.
As both flags are currently defined to the same value, this doesn't
change the KBI, but of course does change the KPI.  A code search via
GitHub and Google fortunately doesn't reveal any outside uses for
CRED_FLAG_CAPMODE.

While here, move assignment of 'ki_uid' to a more logical place in
kvm_proclist(), and definition of XU_NGROUPS as well in 'sys/ucred.h'
(no functional/interface changes intended).

Reviewed by:    mhorne
Approved by:    markj (mentor)
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46909

(cherry picked from commit 09290c3a0c82524138973b14f393379edf733753)

A ports exp-run (PR 283410) showed one port to be affected
(sysutils/procs), which has been fixed upstream and in the ports tree.
All additional indirect references to CRED_FLAG_CAPMODE we found after
the code search mentioned in the original commit message are
automatically generated from our headers by FFI mechanisms, so
automatically disappear at recompilation (and the KBI is not changed, as
explained above, so recompilation is not needed).
2025-04-08 15:38:14 +02:00
..
atf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
clang Merge llvm-project release/19.x llvmorg-19.1.7-0-gcd708029e0b2 2025-01-19 12:05:53 +01:00
csu amd64 csu: microoptimize startup 2025-03-11 02:59:11 +02:00
flua flua: Add hash module 2024-04-16 13:54:20 -06:00
geom geli.8: minor proofreading 2024-05-09 14:24:06 -06:00
googletest Fix GoogleTest 1.14.0 import 2023-08-18 19:33:58 -07:00
lib9p Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
lib80211 lib80211: regdomain: add the two other 160MHz bands 2025-02-10 14:52:12 +00:00
libalias Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libarchive libarchive tests: Re-enable a broken test 2024-11-05 00:55:43 +00:00
libauditd Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libbe zfs: merge openzfs/zfs@e269af1b3 (zfs-2.2-release) into stable/14 2024-12-12 13:22:56 +01:00
libbearssl libsecureboot: be more verbose about validation failures 2024-01-07 14:39:17 -05:00
libbegemot Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libblacklist Track upstream project rename in contrib/blocklistd 2024-01-07 14:31:11 -05:00
libblocksruntime Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libbluetooth Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
libbsddialog Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
libbsdstat Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libbsm Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libbsnmp pkgbase: fix inclusion of tests in ssh, bsnmp, clibs-dev 2025-02-27 14:45:40 -05:00
libbz2 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libc fts: Stop abusing the comma operator. 2025-04-08 10:19:43 +00:00
libc++ Merge llvm-project release/19.x llvmorg-19.1.3-0-gab51eccf88f5 2024-12-01 12:17:17 +01:00
libc++experimental Merge llvm-project main llvmorg-18-init-15088-gd14ee76181fb 2024-04-19 23:12:03 +02:00
libc_nonshared Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libcalendar Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libcam Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libcapsicum manuals: Fix "skipping end of block" .Ed errors 2024-11-04 11:56:24 -04:00
libcasper manuals: Misc macro typos 2024-12-27 10:40:05 -05:00
libcbor libcbor: Ignore errors for unknown #pragmas 2024-09-08 14:03:17 +02:00
libclang_rt Merge llvm-project main llvmorg-19-init-18630-gf2ccf80136a0 2024-12-01 12:16:52 +01:00
libcom_err Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libcompat libutil: move ftime to libutil 2024-06-28 12:17:52 +02:00
libcompiler_rt Merge llvm-project main llvmorg-19-init-18630-gf2ccf80136a0 2024-12-01 12:16:52 +01:00
libcrypt lib/libcrypt: use explicit_bzero() to clear sensitive buffers 2024-10-29 16:45:31 +01:00
libcuse Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
libcxxrt libcxxrt: Add a stub implementation of __cxa_call_terminate 2024-10-29 16:34:21 -04:00
libder lib: hook libder up to the build 2025-01-10 20:48:22 -06:00
libdevctl manuals: Fix some "missing section argument" 2024-11-04 12:15:01 -04:00
libdevdctl Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libdevinfo Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libdevstat Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libdl _dl_iterate_phdr_locked(): fix libc and libdl 2024-11-26 19:15:56 -06:00
libdpv Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libdwarf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libedit Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libefivar Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libelf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libelftc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libevent1 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libexecinfo Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libexpat lib/libexpat: update build config for 2.7.1 2025-04-07 11:38:40 +08:00
libfdt libfdt: Make an internal FDT library available 2024-03-29 09:53:19 -04:00
libfetch libfetch: don't include fragments in HTTP requests 2024-09-05 14:05:15 +00:00
libfido2 libfido2: update to 1.14.0 2024-08-01 11:11:45 -04:00
libfigpar Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libgcc_eh libgcc_{eh,s}: restore __*_frame_info symbols post llvm18 2024-04-20 12:04:35 +02:00
libgcc_s Revert "Export additional __aeabi_ symbols from arm's libgcc_s" 2025-01-04 19:13:25 +01:00
libgeom libgeom: Consistently use item count as the first argument to calloc 2024-11-30 08:55:57 -05:00
libgpio libgpio: Fix type mismatch for gpio_pin_[gs]et 2024-01-03 09:43:48 -08:00
libgssapi Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libiconv_modules Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libifconfig ifconfig: fix reporting optics on most 100g interfaces 2025-03-20 11:27:08 -04:00
libipsec Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libipt Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libiscsiutil Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
libjail manuals: Fix "unusual .Xr" warnings with a script 2024-11-04 12:13:13 -04:00
libkiconv Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libkvm cred: Hide internal flag CRED_FLAG_CAPMODE 2025-04-08 15:38:14 +02:00
libldns Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
liblua dirdeps: Add missing dependency files 2024-04-15 20:32:03 -06:00
liblutok Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
liblzma MFC: MFV: xz 5.6.3 2024-12-21 23:32:54 -08:00
libmagic MFC: libmagic: Unbreak for older FreeBSD releases. 2025-01-12 20:24:19 -08:00
libmd Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
libmemstat Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libmilter Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libmixer mixer(3): Do not skip devices with no volume control 2025-03-04 16:46:07 +01:00
libmp Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libmt Add IBM TS1170 density codes and specs. 2023-12-14 15:55:24 -05:00
libnetbsd Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
libnetgraph Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libnetmap libnetmap: remove interface name validation 2024-09-01 17:56:17 +00:00
libnv Remove "All Rights Reserved" from FreeBSD Foundation copyrights 2024-08-06 15:39:53 -04:00
libomp Merge llvm-project release/19.x llvmorg-19.1.3-0-gab51eccf88f5 2024-12-01 12:17:17 +01:00
libopenbsd Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
libopencsd libopencsd: Remove extra slashes 2025-02-12 01:33:35 +00:00
libpam manuals: Fix "unusual .Xr" warnings with a script 2024-11-04 12:13:13 -04:00
libpathconv manuals: Fix "missing end of block" errors 2024-11-04 12:07:50 -04:00
libpcap libpcap: Update to 1.10.5 2024-10-07 14:27:04 -03:00
libpe Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libpfctl libpfctl: ensure we return useful error codes 2024-09-29 20:29:50 +02:00
libpjdlog Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libpmc jevents: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15 2024-05-02 21:10:13 +01:00
libpmcstat Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libproc Remove "All Rights Reserved" from FreeBSD Foundation copyrights 2024-08-06 15:39:53 -04:00
libprocstat libprocstat: add knowledge about NT_PROCSTAT_KQUEUES core file section 2025-04-07 04:28:22 +03:00
libradius radlib: fix a memory leak in is_valid_request 2024-09-27 20:54:48 -07:00
libregex Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
librpcsec_gss Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
librpcsvc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
librss manuals: Misc syntax fixes 2024-11-04 11:56:24 -04:00
librt zfs: merge openzfs/zfs@32949f256 (zfs-2.2-release) into stable/14 2023-09-03 09:15:24 +02:00
librtld_db Remove "All Rights Reserved" from FreeBSD Foundation copyrights 2024-08-06 15:39:53 -04:00
libsbuf lib/libsbuf/tests: reformat with clang-format 2025-03-26 14:13:54 -07:00
libsdp Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
libsecureboot libsecureboot: Report failure for unsupported hash algorithm 2025-02-18 13:41:07 -05:00
libsm Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libsmb Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libsmdb Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libsmutil Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libsqlite3 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libssp Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libssp_nonshared Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libstats Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libstdbuf Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libstdthreads libstdthreads: destroy mutexattr in mtx_init() 2024-02-09 02:38:04 +02:00
libsysdecode manuals: Fix "unusual .Xr" warnings with a script 2024-11-04 12:13:13 -04:00
libtacplus Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libtelnet Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libthr Canonicalize the name of the FreeBSD Foundation 2025-02-19 09:58:47 -05:00
libthread_db Remove "All Rights Reserved" from FreeBSD Foundation copyrights 2024-08-06 15:39:53 -04:00
libucl Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libufs Defer the January 19, 2038 date limit in UFS1 filesystems to February 7, 2106 2025-02-06 11:25:09 -08:00
libugidfw Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libulog libulog: Make sure ut_line, ut_user, ut_host are terminated. 2024-05-02 11:08:17 +02:00
libunbound unbound: Vendor import 1.22.0 2024-10-24 20:28:45 -07:00
libusb libusb: fix hotplug sigbus 2025-01-07 10:02:57 +01:00
libusbhid libusbhid: add missing include guards 2024-06-09 12:32:16 -04:00
libutil login.conf.5: remove a stray quote 2024-12-13 19:13:53 +00:00
libveriexec manuals: Fix "unusual .Xr" warnings with a script 2024-11-04 12:13:13 -04:00
libvgl Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libvmmapi libvmmapi: add missing capability strings 2024-04-15 10:05:13 -04:00
libwrap Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libxo Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
liby Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libypclnt Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libz lib{c,lzma,z}: remove -DSYMBOL_VERSIONING from CFLAGS 2023-12-13 22:08:13 +00:00
libzstd libzstd: Explicitly define ZSTD_DISABLE_ASM 2023-08-22 21:01:03 +01:00
msun msun: Fix typo in comment 2024-10-21 11:00:49 +08:00
ncurses ncurses: Fix codegen for key names and codes 2024-10-30 08:53:05 +08:00
nss_tacplus nss_tacplus: Provide dummy setpwent(), getpwent_r(), endpwent(). 2023-09-07 20:28:30 +00:00
ofed Trim various $FreeBSD$ 2023-10-24 11:22:23 -07:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile lib: hook libder up to the build 2025-01-10 20:48:22 -06:00
Makefile.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00