mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
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
This commit is contained in:
		
						commit
						d6a624eef1
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
					@ -170,7 +170,7 @@ static int proc_taint(struct ctl_table *table, int write,
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef CONFIG_PRINTK
 | 
					#ifdef CONFIG_PRINTK
 | 
				
			||||||
static int proc_dmesg_restrict(struct ctl_table *table, int write,
 | 
					static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
 | 
				
			||||||
				void __user *buffer, size_t *lenp, loff_t *ppos);
 | 
									void __user *buffer, size_t *lenp, loff_t *ppos);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -703,7 +703,7 @@ static struct ctl_table kern_table[] = {
 | 
				
			||||||
		.data		= &dmesg_restrict,
 | 
							.data		= &dmesg_restrict,
 | 
				
			||||||
		.maxlen		= sizeof(int),
 | 
							.maxlen		= sizeof(int),
 | 
				
			||||||
		.mode		= 0644,
 | 
							.mode		= 0644,
 | 
				
			||||||
		.proc_handler	= proc_dointvec_minmax,
 | 
							.proc_handler	= proc_dointvec_minmax_sysadmin,
 | 
				
			||||||
		.extra1		= &zero,
 | 
							.extra1		= &zero,
 | 
				
			||||||
		.extra2		= &one,
 | 
							.extra2		= &one,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
| 
						 | 
					@ -712,7 +712,7 @@ static struct ctl_table kern_table[] = {
 | 
				
			||||||
		.data		= &kptr_restrict,
 | 
							.data		= &kptr_restrict,
 | 
				
			||||||
		.maxlen		= sizeof(int),
 | 
							.maxlen		= sizeof(int),
 | 
				
			||||||
		.mode		= 0644,
 | 
							.mode		= 0644,
 | 
				
			||||||
		.proc_handler	= proc_dmesg_restrict,
 | 
							.proc_handler	= proc_dointvec_minmax_sysadmin,
 | 
				
			||||||
		.extra1		= &zero,
 | 
							.extra1		= &zero,
 | 
				
			||||||
		.extra2		= &two,
 | 
							.extra2		= &two,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
| 
						 | 
					@ -1943,7 +1943,7 @@ static int proc_taint(struct ctl_table *table, int write,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef CONFIG_PRINTK
 | 
					#ifdef CONFIG_PRINTK
 | 
				
			||||||
static int proc_dmesg_restrict(struct ctl_table *table, int write,
 | 
					static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
 | 
				
			||||||
				void __user *buffer, size_t *lenp, loff_t *ppos)
 | 
									void __user *buffer, size_t *lenp, loff_t *ppos)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (write && !capable(CAP_SYS_ADMIN))
 | 
						if (write && !capable(CAP_SYS_ADMIN))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue