From: Bastian Blank Date: Mon, 23 Apr 2007 21:41:14 +0000 (-0700) Subject: Allow reading tainted flag as user X-Git-Tag: MMI-PSA29.97-13-9~44293 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=91fcd412e957f433e9f1abeb0b1926dbeb66ca80;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git Allow reading tainted flag as user The commit 34f5a39899f3f3e815da64f48ddb72942d86c366 restricted reading of the tainted value. The attached patch changes this back to a write-only check and restores the read behaviour of older versions. Signed-off-by: Bastian Blank Cc: Theodore Ts'o Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 1b255df4fcd0..c904748f2290 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1676,7 +1676,7 @@ static int proc_dointvec_taint(ctl_table *table, int write, struct file *filp, { int op; - if (!capable(CAP_SYS_ADMIN)) + if (write && !capable(CAP_SYS_ADMIN)) return -EPERM; op = OP_OR;