From: Alan Cox Date: Fri, 8 Feb 2008 12:18:45 +0000 (-0800) Subject: rocket: don't let random users reset the controller X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=4129a6454dd925560bf3f46a12eb9f01cf8d5e7e;p=openwrt%2Fstaging%2Fblogic.git rocket: don't let random users reset the controller Signed-off-by: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index cbee71bab017..72f289279d8f 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)