All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel: Restrict permissions of /proc/iomem.
@ 2019-10-25  8:56 zhanglin
  2019-10-25 21:32 ` Andrew Morton
  2019-10-25 21:38 ` Dave Hansen
  0 siblings, 2 replies; 5+ messages in thread
From: zhanglin @ 2019-10-25  8:56 UTC (permalink / raw)
  To: dan.j.williams
  Cc: akpm, jgg, mingo, dave.hansen, namit, bp, christophe.leroy,
	rdunlap, osalvador, richardw.yang, linux-kernel, xue.zhihong,
	wang.yi59, jiang.xuexin, zhanglin

The permissions of /proc/iomem currently are -r--r--r--. Everyone can
see its content. As iomem contains information about the physical memory
content of the device, restrict the information only to root.

Signed-off-by: zhanglin <zhang.lin16@zte.com.cn>
---
 kernel/resource.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/resource.c b/kernel/resource.c
index 30e1bc6..844456e 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -139,7 +139,8 @@ static int __init ioresources_init(void)
 {
 	proc_create_seq_data("ioports", 0, NULL, &resource_op,
 			&ioport_resource);
-	proc_create_seq_data("iomem", 0, NULL, &resource_op, &iomem_resource);
+	proc_create_seq_data("iomem", S_IRUSR, NULL, &resource_op,
+			&iomem_resource);
 	return 0;
 }
 __initcall(ioresources_init);
-- 
2.15.2


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

end of thread, other threads:[~2019-10-29 11:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-25  8:56 [PATCH] kernel: Restrict permissions of /proc/iomem zhanglin
2019-10-25 21:32 ` Andrew Morton
2019-10-28 19:16   ` Kees Cook
2019-10-29 11:05     ` Christian Kujau
2019-10-25 21:38 ` Dave Hansen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.