linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] alloc_tag: Tighten file permissions on /proc/allocinfo
@ 2024-04-25 20:08 Kees Cook
  2024-04-25 20:45 ` Kent Overstreet
  0 siblings, 1 reply; 21+ messages in thread
From: Kees Cook @ 2024-04-25 20:08 UTC (permalink / raw)
  To: Suren Baghdasaryan
  Cc: Kees Cook, Kent Overstreet, Andrew Morton, linux-mm,
	linux-kernel, linux-hardening

The /proc/allocinfo file exposes a tremendous about of information about
kernel build details, memory allocations (obviously), and potentially
even image layout (due to ordering). As this is intended to be consumed
by system owners (like /proc/slabinfo), use the same file permissions as
there: 0400.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
---
 lib/alloc_tag.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c
index 26af9982ddc4..531dbe2f5456 100644
--- a/lib/alloc_tag.c
+++ b/lib/alloc_tag.c
@@ -129,7 +129,7 @@ size_t alloc_tag_top_users(struct codetag_bytes *tags, size_t count, bool can_sl
 
 static void __init procfs_init(void)
 {
-	proc_create_seq("allocinfo", 0444, NULL, &allocinfo_seq_op);
+	proc_create_seq("allocinfo", 0400, NULL, &allocinfo_seq_op);
 }
 
 static bool alloc_tag_module_unload(struct codetag_type *cttype,
-- 
2.34.1


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

end of thread, other threads:[~2024-04-26  8:46 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-25 20:08 [PATCH] alloc_tag: Tighten file permissions on /proc/allocinfo Kees Cook
2024-04-25 20:45 ` Kent Overstreet
2024-04-25 20:51   ` Matthew Wilcox
2024-04-25 21:04     ` Kent Overstreet
2024-04-25 21:21       ` Suren Baghdasaryan
2024-04-25 21:25         ` Kent Overstreet
2024-04-25 21:38         ` Andrew Morton
2024-04-25 21:45           ` Kent Overstreet
2024-04-26  8:32         ` Pavel Machek
2024-04-26  8:46           ` Kent Overstreet
2024-04-25 22:42       ` Kees Cook
2024-04-25 23:02         ` Kent Overstreet
2024-04-25 23:47         ` Andrew Morton
2024-04-26  0:27           ` Kent Overstreet
2024-04-26  0:43             ` Kees Cook
2024-04-26  0:58               ` Kent Overstreet
2024-04-26  3:25                 ` Matthew Wilcox
2024-04-26  3:35                   ` Kent Overstreet
2024-04-26  8:34                   ` Pavel Machek
2024-04-26  0:39           ` Kees Cook
2024-04-25 20:57   ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).