diff options
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/proc/proc_sysctl.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index a781bdf06694..701580ddfcc3 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c | |||
| @@ -378,12 +378,13 @@ static int test_perm(int mode, int op) | |||
| 378 | return -EACCES; | 378 | return -EACCES; |
| 379 | } | 379 | } |
| 380 | 380 | ||
| 381 | static int sysctl_perm(struct ctl_table_root *root, struct ctl_table *table, int op) | 381 | static int sysctl_perm(struct ctl_table_header *head, struct ctl_table *table, int op) |
| 382 | { | 382 | { |
| 383 | struct ctl_table_root *root = head->root; | ||
| 383 | int mode; | 384 | int mode; |
| 384 | 385 | ||
| 385 | if (root->permissions) | 386 | if (root->permissions) |
| 386 | mode = root->permissions(root, current->nsproxy, table); | 387 | mode = root->permissions(head, table); |
| 387 | else | 388 | else |
| 388 | mode = table->mode; | 389 | mode = table->mode; |
| 389 | 390 | ||
| @@ -491,7 +492,7 @@ static ssize_t proc_sys_call_handler(struct file *filp, void __user *buf, | |||
| 491 | * and won't be until we finish. | 492 | * and won't be until we finish. |
| 492 | */ | 493 | */ |
| 493 | error = -EPERM; | 494 | error = -EPERM; |
| 494 | if (sysctl_perm(head->root, table, write ? MAY_WRITE : MAY_READ)) | 495 | if (sysctl_perm(head, table, write ? MAY_WRITE : MAY_READ)) |
| 495 | goto out; | 496 | goto out; |
| 496 | 497 | ||
| 497 | /* if that can happen at all, it should be -EINVAL, not -EISDIR */ | 498 | /* if that can happen at all, it should be -EINVAL, not -EISDIR */ |
| @@ -717,7 +718,7 @@ static int proc_sys_permission(struct inode *inode, int mask) | |||
| 717 | if (!table) /* global root - r-xr-xr-x */ | 718 | if (!table) /* global root - r-xr-xr-x */ |
| 718 | error = mask & MAY_WRITE ? -EACCES : 0; | 719 | error = mask & MAY_WRITE ? -EACCES : 0; |
| 719 | else /* Use the permissions on the sysctl table entry */ | 720 | else /* Use the permissions on the sysctl table entry */ |
| 720 | error = sysctl_perm(head->root, table, mask & ~MAY_NOT_BLOCK); | 721 | error = sysctl_perm(head, table, mask & ~MAY_NOT_BLOCK); |
| 721 | 722 | ||
| 722 | sysctl_head_finish(head); | 723 | sysctl_head_finish(head); |
| 723 | return error; | 724 | return error; |
