Pull security layer fixlet from James Morris. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: sysctl: fix write access to dmesg_restrict/kptr_restrict
Unified · Split
| @@ -170,7 +170,7 @@ static int proc_taint(struct ctl_table *table, int write, · 169 unmodified lines | ||
| 170 | 170 | #endif |
| 171 | 171 | |
| 172 | 172 | #ifdef CONFIG_PRINTK |
| 173 | −static int proc_dmesg_restrict(struct ctl_table *table, int write, | |
| 173 | +static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write, | |
| 174 | 174 | void __user *buffer, size_t *lenp, loff_t *ppos); |
| 175 | 175 | #endif |
| 176 | 176 | |
| @@ -703,7 +703,7 @@ static struct ctl_table kern_table[] = { · 526 unmodified lines | ||
| 703 | 703 | .data = &dmesg_restrict, |
| 704 | 704 | .maxlen = sizeof(int), |
| 705 | 705 | .mode = 0644, |
| 706 | − .proc_handler = proc_dointvec_minmax, | |
| 706 | + .proc_handler = proc_dointvec_minmax_sysadmin, | |
| 707 | 707 | .extra1 = &zero, |
| 708 | 708 | .extra2 = &one, |
| 709 | 709 | }, |
| @@ -712,7 +712,7 @@ static struct ctl_table kern_table[] = { · 2 unmodified lines | ||
| 712 | 712 | .data = &kptr_restrict, |
| 713 | 713 | .maxlen = sizeof(int), |
| 714 | 714 | .mode = 0644, |
| 715 | − .proc_handler = proc_dmesg_restrict, | |
| 715 | + .proc_handler = proc_dointvec_minmax_sysadmin, | |
| 716 | 716 | .extra1 = &zero, |
| 717 | 717 | .extra2 = &two, |
| 718 | 718 | }, |
| @@ -1943,7 +1943,7 @@ static int proc_taint(struct ctl_table *table, int write, · 1224 unmodified lines | ||
| 1943 | 1943 | } |
| 1944 | 1944 | |
| 1945 | 1945 | #ifdef CONFIG_PRINTK |
| 1946 | −static int proc_dmesg_restrict(struct ctl_table *table, int write, | |
| 1946 | +static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write, | |
| 1947 | 1947 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 1948 | 1948 | { |
| 1949 | 1949 | if (write && !capable(CAP_SYS_ADMIN)) |