Mark Johnston
f5d6f7cb47
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 3d7618d8bf0b7. 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-04-03 04:14:02 -04:00
..
2022-06-23 16:07:00 -03:00
2022-05-20 14:54:03 +03:00
2022-12-08 14:32:03 +00:00
2022-09-16 23:23:26 +03:00
2022-07-18 22:06:09 +00:00
2023-04-03 04:13:52 -04:00
2022-05-28 20:52:17 +03:00
2022-03-24 10:20:51 +00:00
2022-02-21 20:15:45 -04:00
2023-03-03 11:16:41 -05:00
2022-07-11 15:58:43 -04:00
2022-08-20 09:44:05 +00:00
2022-07-26 19:59:56 +02:00
2022-05-28 20:52:17 +03:00
2022-05-06 15:46:58 -07:00
2023-01-30 19:28:54 +03:00
2022-03-24 10:20:51 +00:00
2022-12-29 22:55:39 +02:00
2022-12-02 10:48:02 -07:00
2022-07-26 19:59:57 +02:00
2022-05-13 10:43:19 -03:00
2023-01-30 10:47:56 -07:00
2023-04-03 04:13:51 -04:00
2022-12-08 14:32:03 +00:00
2023-04-03 04:13:57 -04:00
2022-05-28 20:52:17 +03:00
2022-09-05 11:54:47 +00:00
2022-10-15 15:51:44 -03:00
2023-04-03 04:12:54 -04:00
2022-03-07 10:47:27 -05:00
2023-02-09 11:58:06 -04:00
2022-07-18 22:06:09 +00:00
2022-08-02 21:11:10 +03:00
2022-07-18 22:06:09 +00:00
2023-02-22 11:12:22 -04:00
2022-09-14 23:04:22 +00:00
2022-09-22 15:09:19 -07:00
2023-02-06 12:32:04 -05:00
2023-02-06 14:00:52 -05:00
2021-12-09 18:09:53 +00:00
2023-02-27 15:10:55 -07:00
2022-09-16 21:49:16 -06:00
2023-02-09 17:13:02 -04:00
2022-08-02 21:11:09 +03:00
2022-08-20 20:34:30 +03:00
2023-04-03 04:13:55 -04:00
2022-08-02 21:11:09 +03:00
2022-05-28 20:52:17 +03:00
2022-07-26 19:59:57 +02:00
2022-08-23 19:15:48 +00:00
2022-12-28 22:43:49 +00:00
2022-07-18 16:27:32 +02:00
2023-04-03 04:14:02 -04:00
2022-12-23 01:53:41 +02:00
2023-02-09 12:01:32 -04:00
2023-02-21 13:49:14 +00:00
2023-02-09 12:01:32 -04:00
2021-12-28 09:41:08 -08:00
2023-01-27 07:09:22 -08:00
2023-02-27 15:10:55 -07:00
2022-08-08 19:44:17 +03:00
2023-02-03 00:37:31 +00:00
2023-02-24 19:26:36 +00:00
2023-04-03 04:12:21 -04:00
2022-03-20 11:31:16 -07:00
2023-01-20 23:33:11 +02:00
2023-04-03 04:12:20 -04:00
2023-04-03 04:11:47 -04:00
2022-10-17 15:12:13 -03:00
2022-03-24 10:20:51 +00:00
2022-11-15 14:17:10 +00:00
2021-12-08 23:32:29 +02:00
2021-12-28 09:41:08 -08:00
2022-11-27 13:22:31 -07:00
2022-05-28 20:52:17 +03:00
2023-02-09 12:01:32 -04:00
2023-02-09 12:01:32 -04:00
2022-10-29 11:10:58 -04:00
2021-12-28 09:41:08 -08:00
2022-07-26 19:59:57 +02:00
2022-12-07 11:30:04 -07:00
2022-01-05 13:50:40 -08:00
2022-12-05 17:00:26 -07:00
2022-07-14 13:13:10 -07:00
2022-09-22 15:09:19 -07:00
2022-01-20 08:23:38 -05:00
2023-01-27 17:22:31 +00:00
2022-10-29 11:10:58 -04:00
2022-10-05 09:56:17 +01:00
2022-08-29 13:22:36 -04:00
2023-02-02 00:59:26 +02:00
2022-04-02 14:15:27 +02:00
2023-04-03 04:12:47 -04:00
2023-04-03 04:14:02 -04:00
2021-12-14 14:52:25 +00:00
2022-09-16 17:29:37 +00:00
2022-10-29 11:10:58 -04:00
2022-05-07 09:32:22 -06:00
2023-03-01 11:05:12 +00:00
2022-07-18 22:06:09 +00:00
2023-04-03 04:10:05 -04:00
2022-07-18 22:06:09 +00:00
2022-08-02 21:11:09 +03:00
2022-07-18 22:06:09 +00:00
2022-08-20 20:33:17 +03:00
2023-01-29 16:18:17 +03:00
2023-04-03 04:10:12 -04:00
2022-09-07 23:46:19 -05:00
2022-12-22 23:11:35 +02:00
2022-05-17 15:10:20 +03:00
2022-08-02 21:11:10 +03:00
2022-07-18 22:06:09 +00:00
2022-10-08 10:41:21 +00:00
2023-02-02 18:19:29 +01:00
2022-02-22 18:53:43 +00:00
2022-06-18 12:34:25 +03:00
2022-12-14 10:02:44 -08:00
2022-09-14 21:29:31 -06:00
2022-12-22 23:11:35 +02:00
2022-12-14 17:39:25 -05:00
2023-04-03 04:13:52 -04:00
2023-04-03 04:13:51 -04:00
2023-04-03 04:13:52 -04:00
2023-02-21 16:02:46 +02:00
2022-07-26 19:59:57 +02:00
2023-02-08 00:11:10 +00:00
2022-03-21 10:27:35 +00:00
2022-07-02 08:02:12 -06:00
2022-04-12 17:30:04 -04:00
2022-05-28 20:52:17 +03:00
2022-08-20 09:44:05 +00:00
2022-02-22 18:53:43 +00:00
2022-08-29 19:15:01 -07:00
2022-09-28 10:20:09 +00:00
2023-04-03 04:12:47 -04:00
2021-12-29 09:23:52 +01:00
2022-08-29 19:14:25 -07:00
2022-09-17 09:10:38 +00:00
2021-11-17 20:12:26 +00:00
2022-12-09 14:17:12 +02:00
2022-09-28 10:20:09 +00:00
2023-04-03 04:12:25 -04:00
2023-02-13 18:20:29 +00:00
2023-02-21 08:50:07 -08:00
2022-12-19 08:07:23 +00:00
2023-02-15 13:32:52 -08:00
2023-03-01 10:15:54 -05:00
2023-04-03 04:12:53 -04:00
2023-02-07 23:03:20 +00:00
2023-02-21 13:00:42 -08:00
2022-12-19 08:07:23 +00:00
2022-09-26 18:03:34 -06:00
2022-12-26 17:35:12 +00:00
2023-03-02 13:09:01 -08:00
2023-02-24 19:30:49 +00:00
2023-04-03 04:12:52 -04:00
2022-12-19 08:09:37 +00:00
2023-02-04 20:32:07 +02:00
2022-08-07 16:08:43 +02:00