git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Capabilities: BUG when an invalid capability is requested
[safe/jmp/linux-2.6]
/
kernel
/
capability.c
diff --git
a/kernel/capability.c
b/kernel/capability.c
index
19f9eda
..
adb262f
100644
(file)
--- a/
kernel/capability.c
+++ b/
kernel/capability.c
@@
-514,6
+514,11
@@
asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data)
*/
int capable(int cap)
{
+ if (unlikely(!cap_valid(cap))) {
+ printk(KERN_CRIT "capable() called with invalid cap=%u\n", cap);
+ BUG();
+ }
+
if (has_capability(current, cap)) {
current->flags |= PF_SUPERPRIV;
return 1;