opnsense-src/lib/libkvm
Olivier Certner 09290c3a0c
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
2024-12-16 15:42:29 +01:00
..
tests Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
kvm.3 lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
kvm.c lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
kvm.h lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kvm_aarch64.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
kvm_amd64.c lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
kvm_amd64.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
kvm_arm.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kvm_arm.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
kvm_cptime.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kvm_getcptime.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kvm_geterr.3 lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
kvm_getloadavg.3 lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
kvm_getloadavg.c lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
kvm_getpcpu.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kvm_getprocs.3 lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
kvm_getswapinfo.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kvm_getswapinfo.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kvm_i386.c lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
kvm_i386.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
kvm_kerndisp.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kvm_minidump_aarch64.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
kvm_minidump_amd64.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
kvm_minidump_arm.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
kvm_minidump_i386.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
kvm_minidump_powerpc64.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kvm_minidump_powerpc64_hpt.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kvm_minidump_riscv.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
kvm_native.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kvm_nlist.3 lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
kvm_open.3 lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
kvm_pcpu.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kvm_powerpc.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kvm_powerpc64.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kvm_powerpc64.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
kvm_private.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kvm_private.h lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
kvm_proc.c cred: Hide internal flag CRED_FLAG_CAPMODE 2024-12-16 15:42:29 +01:00
kvm_read.3 lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
kvm_riscv.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
kvm_vnet.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
Makefile Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00