]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
afs: proc cells and rootcell are writeable
authorPali Rohár <pali.rohar@gmail.com>
Tue, 28 Jan 2014 20:26:44 +0000 (20:26 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 1 Feb 2014 18:59:39 +0000 (10:59 -0800)
Both proc files are writeable and used for configuring cells. But
there is missing correct mode flag for writeable files. Without
this patch both proc files are read only.

[ It turns out they aren't really read-only, since root can write to
  them even if the write bit isn't set due to CAP_DAC_OVERRIDE ]

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/afs/proc.c

index bddc5120ed4089caa19bef3c2420725c63ef7f37..24a905b076fd77268c74978053afef93ba4ef5d9 100644 (file)
@@ -130,8 +130,8 @@ int afs_proc_init(void)
        if (!proc_afs)
                goto error_dir;
 
-       if (!proc_create("cells", 0, proc_afs, &afs_proc_cells_fops) ||
-           !proc_create("rootcell", 0, proc_afs, &afs_proc_rootcell_fops))
+       if (!proc_create("cells", 0644, proc_afs, &afs_proc_cells_fops) ||
+           !proc_create("rootcell", 0644, proc_afs, &afs_proc_rootcell_fops))
                goto error_tree;
 
        _leave(" = 0");