Skip to contentSkip to conversation

procfs privacy: /proc/iomem & /proc/ioports

PATCH In review Lorenzo Hernández García-Hierro 1 participant 1 message Apr 18, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 7/7 procfs privacy: /proc/iomem & /proc/ioports

This patch changes the permissions of the procfs entries ioports and iomem to restrict non-root users from accessing them.

It's also available at
http://pearls.tuxedo-es.org/patches/security/proc-privacy-1_kernel_resource.c.patch.

(last patch from the procfs privacy patch-set)

The whole patch is available at:
http://pearls.tuxedo-es.org/patches/security/proc-privacy-1.patch

Cheers,

Signature · 2 lines
Lorenzo Hernández García-Hierro <[email protected]> 
[1024D/6F2B2DEC] & [2048g/9AE91A22][http://tuxedo-es.org]
kernel/resource.c renamed from kernel/resource.c~proc-privacy-1 +2 -2
diff -puN kernel/resource.c~proc-privacy-1 kernel/resource.c
@@ -136,10 +136,10 @@ static int __init ioresources_init(void)
 {
 	struct proc_dir_entry *entry;
 
-	entry = create_proc_entry("ioports", 0, NULL);
+	entry = create_proc_entry("ioports", S_IRUSR, NULL);
 	if (entry)
 		entry->proc_fops = &proc_ioports_operations;
-	entry = create_proc_entry("iomem", 0, NULL);
+	entry = create_proc_entry("iomem", S_IRUSR, NULL);
 	if (entry)
 		entry->proc_fops = &proc_iomem_operations;
 	return 0;