DragonFly BSD
DragonFly bugs List (threaded) for 2010-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

"invalid privilege" in firmware_get()


From: Johannes Hofmann <johannes.hofmann@xxxxxx>
Date: 15 Apr 2010 20:37:44 GMT

firmware_get() in the recently ported subr_firmware.c causes a panic
when loading a firmware image.
The patch below fixes the issue:

diff --git a/sys/kern/subr_firmware.c b/sys/kern/subr_firmware.c
index 0cf58a8..b103e8f 100644
--- a/sys/kern/subr_firmware.c
+++ b/sys/kern/subr_firmware.c
@@ -321,7 +321,7 @@ firmware_get(const char *imagename)
 	 */
 	td = curthread;
 	if (priv_check(td, PRIV_FIRMWARE_LOAD) != 0 ||
-	    priv_check_cred(td->td_ucred, 0, 0)) {
+	    priv_check_cred(td->td_ucred, PRIV_ROOT, 0)) {
 		lockmgr(&firmware_lock, LK_RELEASE);
 		kprintf("%s: insufficient privileges to "
 		    "load firmware image %s\n", __func__, imagename);



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]