1
0
Fork 0

rocket: don't let random users reset the controller

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
hifive-unleashed-5.1
Alan Cox 2008-02-08 04:18:45 -08:00 committed by Linus Torvalds
parent 6df3526b66
commit 4129a6454d
1 changed files with 3 additions and 0 deletions

View File

@ -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)