From 4129a6454dd925560bf3f46a12eb9f01cf8d5e7e Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 8 Feb 2008 04:18:45 -0800 Subject: [PATCH] rocket: don't let random users reset the controller Signed-off-by: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/rocket.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index cbee71bab01..72f289279d8 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c @@ -1399,6 +1399,9 @@ static int reset_rm2(struct r_port *info, void __user *arg) { int reset; + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + if (copy_from_user(&reset, arg, sizeof (int))) return -EFAULT; if (reset) -- 2.20.1