Skip to contentSkip to conversation

kmemleak: change /sys/kernel/debug/kmemleak permissions from 0444 to 0644

PATCH Applied Konstantin Khlebnikov 2 participants 2 messages Oct 6, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kmemleak: change /sys/kernel/debug/kmemleak permissions from 0444 to 0644

Kmemleak could be tweaked in runtime by writing commands into debugfs file. Root anyway can use it, but without write-bit this interface isn't obvious.

---
 mm/kmemleak.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/kmemleak.c +1 -1
index 7780cd83a495..fca3452e56c1 100644
@@ -2104,7 +2104,7 @@ static int __init kmemleak_late_init(void)
 		return -ENOMEM;
 	}
 
-	dentry = debugfs_create_file("kmemleak", S_IRUGO, NULL, NULL,
+	dentry = debugfs_create_file("kmemleak", 0644, NULL, NULL,
 				     &kmemleak_fops);
 	if (!dentry)
 		pr_warn("Failed to create the debugfs kmemleak file\n");

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 13 lines · Konstantin Khlebnikov

Kmemleak could be tweaked in runtime by writing commands into debugfs file. Root anyway can use it, but without write-bit this interface isn't obvious.

---
 mm/kmemleak.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/kmemleak.c +0 -0
index 7780cd83a495..fca3452e56c1 100644

mm/kmemleak.c static int __init kmemleak_late_init(void) · line 2110

Quoted 8 lines
mm/kmemleak.c +1 -1
@@ -2104,7 +2104,7 @@ static int __init kmemleak_late_init(void)
 		return -ENOMEM;
 	}
 
-	dentry = debugfs_create_file("kmemleak", S_IRUGO, NULL, NULL,
+	dentry = debugfs_create_file("kmemleak", 0644, NULL, NULL,
 				     &kmemleak_fops);
 	if (!dentry)
 		pr_warn("Failed to create the debugfs kmemleak file\n");
Signature · 7 lines
Catalin

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>