Re: [Patch] proc: drop write permission on 'timer_list' and 'slabinfo'

From: Amerigo Wang
Date: Mon Aug 17 2009 - 23:07:43 EST


Li Zefan wrote:
static int __init slab_proc_init(void)
{
- proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations);
+ proc_create("slabinfo",S_IRUSR|S_IRUGO,NULL,&proc_slabinfo_operations);

S_IRUSR|S_IRUGO == S_IRUGO


Ah, yeah. Thanks!

Update it.

Signed-off-by: WANG Cong <amwang@xxxxxxxxxx>


diff --git a/mm/slub.c b/mm/slub.c
index b9f1491..61398c0 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4726,7 +4726,7 @@ static const struct file_operations proc_slabinfo_operations = {

static int __init slab_proc_init(void)
{
- proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations);
+ proc_create("slabinfo",S_IRUGO,NULL,&proc_slabinfo_operations);
return 0;
}
module_init(slab_proc_init);