Skip to contentSkip to conversation

rocket: Don't let random users reset the controller

PATCH New Alan Cox 1 participant 1 message Nov 19, 2007 Char and misc drivers

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 rocket: Don't let random users reset the controller

drivers/char/rocket.c +3 -0
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.24-rc2-mm1/drivers/char/rocket.c linux-2.6.24-rc2-mm1/drivers/char/rocket.c
@@ -1401,6 +1399,9 @@
 {
 	int reset;
 
+	if (!capable(CAP_SYS_ADMIN))
+		return -EPERM;
+
 	if (copy_from_user(&reset, arg, sizeof (int)))
 		return -EFAULT;
 	if (reset)