summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_firmware.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/subr_firmware.c')
-rw-r--r--sys/kern/subr_firmware.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/subr_firmware.c b/sys/kern/subr_firmware.c
index 6de4fa4..a83e567 100644
--- a/sys/kern/subr_firmware.c
+++ b/sys/kern/subr_firmware.c
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
#include <sys/errno.h>
#include <sys/linker.h>
#include <sys/firmware.h>
+#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/module.h>
@@ -190,7 +191,8 @@ again:
return NULL;
}
td = curthread;
- if (suser(td) != 0 || securelevel_gt(td->td_ucred, 0) != 0) {
+ if (priv_check(td, PRIV_FIRMWARE_LOAD) != 0 ||
+ securelevel_gt(td->td_ucred, 0) != 0) {
printf("%s: insufficient privileges to "
"load firmware image %s\n", __func__, imagename);
return NULL;
OpenPOWER on IntegriCloud