freebsd-dev/share
Mark Johnston cab1056105 kdb: Modify securelevel policy
Currently, sysctls which enable KDB in some way are flagged with
CTLFLAG_SECURE, meaning that you can't modify them if securelevel > 0.
This is so that KDB cannot be used to lower a running system's
securelevel, see commit 3d7618d8bf.  However, the newer mac_ddb(4)
restricts DDB operations which could be abused to lower securelevel
while retaining some ability to gather useful debugging information.

To enable the use of KDB (specifically, DDB) on systems with a raised
securelevel, change the KDB sysctl policy: rather than relying on
CTLFLAG_SECURE, add a check of the current securelevel to kdb_trap().
If the securelevel is raised, only pass control to the backend if MAC
specifically grants access; otherwise simply check to see if mac_ddb
vetoes the request, as before.

Add a new secure sysctl, debug.kdb.enter_securelevel, to override this
behaviour.  That is, the sysctl lets one enter a KDB backend even with a
raised securelevel, so long as it is set before the securelevel is
raised.

Reviewed by:	mhorne, stevek
MFC after:	1 month
Sponsored by:	Juniper Networks
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37122
2023-03-30 10:45:00 -04:00
..
colldef locales: fix installation of some collation files 2022-04-05 09:19:31 +02:00
colldef_unicode locales: Update to CLDR 41.0 and Unicode 14.0 2022-04-21 14:16:40 +02:00
ctypedef locales: Update to CLDR 41.0 and Unicode 14.0 2022-04-21 14:16:40 +02:00
dict Add "heard" to the dictionary 2022-08-09 12:03:24 -04:00
doc usd: Fix two typos 2022-04-02 15:16:02 +02:00
dtrace dtrace: fix ipfw_rule_info_t translator 2021-09-02 16:35:01 +03:00
examples vmrun: Expose bhyve's -G option 2023-03-20 16:26:54 -04:00
i18n i18n: csmapper: hook up the top-level .src files to the build 2023-02-28 22:26:44 -06:00
keys pkgbase: Add a FreeBSD-pkg-bootstrap package 2021-12-21 10:17:48 +01:00
man kdb: Modify securelevel policy 2023-03-30 10:45:00 -04:00
misc committers-ports.dot: Fix alexbl entry 2023-03-30 14:46:47 +02:00
mk Remove LLVM build glue for MIPS as a native architecture. 2023-03-29 15:06:15 -07:00
monetdef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
monetdef_unicode locales: Update to CLDR 41.0 and Unicode 14.0 2022-04-21 14:16:40 +02:00
msgdef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
msgdef_unicode locales: Update to CLDR 41.0 and Unicode 14.0 2022-04-21 14:16:40 +02:00
numericdef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
numericdef_unicode locales: Update to CLDR 41.0 and Unicode 14.0 2022-04-21 14:16:40 +02:00
security
sendmail
skel sh(1): fix home/del key on mobaxterm env 2021-10-20 14:00:20 +02:00
snmp pkgbase: Put the mibs and defs in the bnsmp package 2021-06-19 17:50:03 +02:00
syscons Correct typos: s/mit Aksenten/mit Akzenten 2022-09-14 11:53:44 +02:00
tabset
termcap Fix mergemaster(8) breakage in the 6ad780caa. 2022-09-13 13:36:22 -07:00
tests
timedef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
vt Correct typos: s/mit Aksenten/mit Akzenten 2022-09-14 11:53:44 +02:00
zoneinfo zoneinfo: Always produce fat zoneinfo files. 2023-01-25 18:03:05 +01:00
Makefile locales: now that C.UTF-8 is the default locale, always install it 2021-07-23 16:58:20 +02:00
Makefile.inc