mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][2.6.0-test3] i386 cpuid.c devfs support 2/2
@ 2003-08-10  8:52 Andrey Borzenkov
  2003-08-10 13:59 ` Dave Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Andrey Borzenkov @ 2003-08-10  8:52 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 104 bytes --]

the same question about default permissions as for msr.c; the same problem 
with module unload.

-andrey

[-- Attachment #2: 2.6.0-test3-cpuid_devfs.patch --]
[-- Type: text/x-diff, Size: 957 bytes --]

--- linux-2.6.0-test3-smp/arch/i386/kernel/cpuid.c.devfs	2003-05-05 03:52:48.000000000 +0400
+++ linux-2.6.0-test3-smp/arch/i386/kernel/cpuid.c	2003-08-09 22:30:39.000000000 +0400
@@ -39,6 +39,8 @@
 #include <linux/smp_lock.h>
 #include <linux/fs.h>
 
+#include <linux/devfs_fs_kernel.h>
+
 #include <asm/processor.h>
 #include <asm/msr.h>
 #include <asm/uaccess.h>
@@ -156,17 +158,27 @@ static struct file_operations cpuid_fops
 
 int __init cpuid_init(void)
 {
+  int i;
+
   if (register_chrdev(CPUID_MAJOR, "cpu/cpuid", &cpuid_fops)) {
     printk(KERN_ERR "cpuid: unable to get major %d for cpuid\n",
 	   CPUID_MAJOR);
     return -EBUSY;
   }
 
+  for (i = 0; i < NR_CPUS; i++)
+    devfs_mk_cdev(MKDEV(CPUID_MAJOR, i), S_IFCHR | S_IRUGO, "cpu/%d/cpuid", i);
+
   return 0;
 }
 
 void __exit cpuid_exit(void)
 {
+  int i;
+
+  for (i = 0; i < NR_CPUS; i++)
+    devfs_remove("cpu/%d/cpuid", i);
+
   unregister_chrdev(CPUID_MAJOR, "cpu/cpuid");
 }
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][2.6.0-test3] i386 cpuid.c devfs support 2/2
  2003-08-10  8:52 [PATCH][2.6.0-test3] i386 cpuid.c devfs support 2/2 Andrey Borzenkov
@ 2003-08-10 13:59 ` Dave Jones
  2003-08-10 14:14   ` Andrey Borzenkov
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Jones @ 2003-08-10 13:59 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: linux-kernel

On Sun, Aug 10, 2003 at 12:52:26PM +0400, Andrey Borzenkov wrote:
 > the same question about default permissions as for msr.c; the same problem 
 > with module unload.

cpuid is less harmful than msr, but it's possible some admins may not
want their users being able to read things like CPU serial numbers
(if enabled).

		Dave

-- 
 Dave Jones     http://www.codemonkey.org.uk

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][2.6.0-test3] i386 cpuid.c devfs support 2/2
  2003-08-10 13:59 ` Dave Jones
@ 2003-08-10 14:14   ` Andrey Borzenkov
  0 siblings, 0 replies; 3+ messages in thread
From: Andrey Borzenkov @ 2003-08-10 14:14 UTC (permalink / raw)
  To: Dave Jones; +Cc: linux-kernel

On Sunday 10 August 2003 17:59, Dave Jones wrote:
> On Sun, Aug 10, 2003 at 12:52:26PM +0400, Andrey Borzenkov wrote:
>  > the same question about default permissions as for msr.c; the same
>  > problem with module unload.
>
> cpuid is less harmful than msr, but it's possible some admins may not
> want their users being able to read things like CPU serial numbers
> (if enabled).
>

should it be 400 or 440 by default? Microcode sets permissions to 640.

-andrey

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-08-10 14:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-10  8:52 [PATCH][2.6.0-test3] i386 cpuid.c devfs support 2/2 Andrey Borzenkov
2003-08-10 13:59 ` Dave Jones
2003-08-10 14:14   ` Andrey Borzenkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®