diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-09-18 17:01:12 -0400 |
---|---|---|
committer | Live-CD User <linux@linux.site> | 2009-09-19 15:50:38 -0400 |
commit | e454cea20bdcff10ee698d11b8882662a0153a47 (patch) | |
tree | f44581fe57787aef0a4f4dc00993a90ea8e688f6 /arch/x86/kernel/msr.c | |
parent | 78f28b7c555359c67c2a0d23f7436e915329421e (diff) |
Driver-Core: extend devnode callbacks to provide permissions
This allows subsytems to provide devtmpfs with non-default permissions
for the device node. Instead of the default mode of 0600, null, zero,
random, urandom, full, tty, ptmx now have a mode of 0666, which allows
non-privileged processes to access standard device nodes in case no
other userspace process applies the expected permissions.
This also fixes a wrong assignment in pktcdvd and a checkpatch.pl complain.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/x86/kernel/msr.c')
-rw-r--r-- | arch/x86/kernel/msr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c index 7dd950094178..6a3cefc7dda1 100644 --- a/arch/x86/kernel/msr.c +++ b/arch/x86/kernel/msr.c | |||
@@ -241,7 +241,7 @@ static struct notifier_block __refdata msr_class_cpu_notifier = { | |||
241 | .notifier_call = msr_class_cpu_callback, | 241 | .notifier_call = msr_class_cpu_callback, |
242 | }; | 242 | }; |
243 | 243 | ||
244 | static char *msr_nodename(struct device *dev) | 244 | static char *msr_devnode(struct device *dev, mode_t *mode) |
245 | { | 245 | { |
246 | return kasprintf(GFP_KERNEL, "cpu/%u/msr", MINOR(dev->devt)); | 246 | return kasprintf(GFP_KERNEL, "cpu/%u/msr", MINOR(dev->devt)); |
247 | } | 247 | } |
@@ -262,7 +262,7 @@ static int __init msr_init(void) | |||
262 | err = PTR_ERR(msr_class); | 262 | err = PTR_ERR(msr_class); |
263 | goto out_chrdev; | 263 | goto out_chrdev; |
264 | } | 264 | } |
265 | msr_class->nodename = msr_nodename; | 265 | msr_class->devnode = msr_devnode; |
266 | for_each_online_cpu(i) { | 266 | for_each_online_cpu(i) { |
267 | err = msr_device_create(i); | 267 | err = msr_device_create(i); |
268 | if (err != 0) | 268 | if (err != 0) |