From: Bastian Blank Date: Mon, 23 Apr 2007 21:41:14 +0000 (-0700) Subject: Allow reading tainted flag as user X-Git-Tag: v2.6.21~17 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=91fcd412e957f433e9f1abeb0b1926dbeb66ca80;p=linux-2.6-omap-h63xx.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 1b255df4fcd..c904748f229 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;