Skip to content

Commit

Permalink
rocket: don't let random users reset the controller
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Feb 8, 2008
1 parent 6df3526 commit 4129a64
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/char/rocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4129a64

Please sign in to comment.