mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-11 04:42:16 +01:00
Add new privilege PRIV_KDB_SET_BACKEND
Summary: Check for PRIV_KDB_SET_BACKEND before allowing a thread to change the KDB backend. Obtained from: Juniper Networks, Inc. Reviewers: sjg, emaste Subscribers: imp Differential Revision: https://reviews.freebsd.org/D39538
This commit is contained in:
parent
c753f49f70
commit
4819e5aeda
@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/pcpu.h>
|
||||
#include <sys/priv.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/sbuf.h>
|
||||
#include <sys/smp.h>
|
||||
@ -484,6 +485,11 @@ int
|
||||
kdb_dbbe_select(const char *name)
|
||||
{
|
||||
struct kdb_dbbe *be, **iter;
|
||||
int error;
|
||||
|
||||
error = priv_check(curthread, PRIV_KDB_SET_BACKEND);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
SET_FOREACH(iter, kdb_dbbe_set) {
|
||||
be = *iter;
|
||||
|
@ -515,10 +515,15 @@
|
||||
#define PRIV_KMEM_READ 680 /* Open mem/kmem for reading. */
|
||||
#define PRIV_KMEM_WRITE 681 /* Open mem/kmem for writing. */
|
||||
|
||||
/*
|
||||
* Kernel debugger privileges.
|
||||
*/
|
||||
#define PRIV_KDB_SET_BACKEND 690 /* Allow setting KDB backend. */
|
||||
|
||||
/*
|
||||
* Track end of privilege list.
|
||||
*/
|
||||
#define _PRIV_HIGHEST 682
|
||||
#define _PRIV_HIGHEST 691
|
||||
|
||||
/*
|
||||
* Validate that a named privilege is known by the privilege system. Invalid
|
||||
|
Loading…
Reference in New Issue
Block a user