Skip to content

Commit

Permalink
Remove easily user-triggerable BUG from generic_setlease
Browse files Browse the repository at this point in the history
commit 8d657eb upstream.

This can be trivially triggered from userspace by passing in something unexpected.

    kernel BUG at fs/locks.c:1468!
    invalid opcode: 0000 [#1] SMP
    RIP: 0010:generic_setlease+0xc2/0x100
    Call Trace:
      __vfs_setlease+0x35/0x40
      fcntl_setlease+0x76/0x150
      sys_fcntl+0x1c6/0x810
      system_call_fastpath+0x1a/0x1f

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
  • Loading branch information
Dave Jones authored and bwhacks committed Jul 25, 2012
1 parent 631a86f commit 8f2c5a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ int generic_setlease(struct file *filp, long arg, struct file_lock **flp)
case F_WRLCK:
return generic_add_lease(filp, arg, flp);
default:
BUG();
return -EINVAL;
}
}
EXPORT_SYMBOL(generic_setlease);
Expand Down

0 comments on commit 8f2c5a7

Please sign in to comment.