]> git.hungrycats.org Git - linux/commitdiff
powernv: Fix permissions on sysparam sysfs entries
authorAnton Blanchard <anton@samba.org>
Sat, 7 Jun 2014 01:29:01 +0000 (11:29 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jul 2014 01:59:11 +0000 (18:59 -0700)
commit 1bd098903fda069cb96fe8b5cb4595b46c683385 upstream.

Everyone can write to these files, which is not what we want.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/platforms/powernv/opal-sysparam.c

index d202f9bc3683f5ad0072282173ddfb510b1aec9a..9d1acf22a099dfc1bf474f6244af11d1153742f6 100644 (file)
@@ -260,10 +260,10 @@ void __init opal_sys_param_init(void)
                        attr[i].kobj_attr.attr.mode = S_IRUGO;
                        break;
                case OPAL_SYSPARAM_WRITE:
-                       attr[i].kobj_attr.attr.mode = S_IWUGO;
+                       attr[i].kobj_attr.attr.mode = S_IWUSR;
                        break;
                case OPAL_SYSPARAM_RW:
-                       attr[i].kobj_attr.attr.mode = S_IRUGO | S_IWUGO;
+                       attr[i].kobj_attr.attr.mode = S_IRUGO | S_IWUSR;
                        break;
                default:
                        break;