linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] afs: proc cells and rootcell are writeable
@ 2014-01-26 12:27 David Howells
  2014-01-26 19:23 ` Linus Torvalds
                   ` (4 more replies)
  0 siblings, 5 replies; 31+ messages in thread
From: David Howells @ 2014-01-26 12:27 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-afs, Pali Rohár

From: Pali Rohár <pali.rohar@gmail.com>

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.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
---

 fs/afs/proc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/afs/proc.c b/fs/afs/proc.c
index 526e4bbbde59..276cb6ed0b93 100644
--- a/fs/afs/proc.c
+++ b/fs/afs/proc.c
@@ -147,11 +147,11 @@ int afs_proc_init(void)
 	if (!proc_afs)
 		goto error_dir;
 
-	p = proc_create("cells", 0, proc_afs, &afs_proc_cells_fops);
+	p = proc_create("cells", S_IFREG | S_IRUGO | S_IWUSR, proc_afs, &afs_proc_cells_fops);
 	if (!p)
 		goto error_cells;
 
-	p = proc_create("rootcell", 0, proc_afs, &afs_proc_rootcell_fops);
+	p = proc_create("rootcell", S_IFREG | S_IRUGO | S_IWUSR, proc_afs, &afs_proc_rootcell_fops);
 	if (!p)
 		goto error_rootcell;
 


^ permalink raw reply related	[flat|nested] 31+ messages in thread
* Re: [PATCH] afs: proc cells and rootcell are writeable
@ 2014-01-27 12:33 Alexey Dobriyan
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Dobriyan @ 2014-01-27 12:33 UTC (permalink / raw)
  To: mingo; +Cc: Linus Torvalds, David Howells, pali.rohar, Linux Kernel

Ingo wrote:
> Perhaps we could also generate the most common variants as:
>
>  #define PERM__rw_r__r__ 0644

You're not alone!
http://lkml.indiana.edu/hypermail/linux/kernel/0607.3/1325.html

But I think 0644 is obvious and the most right way.

Of course, proc should detect those (->write vs ->mode) and complain.
Something I never sent.

^ permalink raw reply	[flat|nested] 31+ messages in thread
* [PATCH] afs: proc cells and rootcell are writeable
@ 2013-11-20 13:30 Pali Rohár
  2013-12-10  8:02 ` Pali Rohár
                   ` (2 more replies)
  0 siblings, 3 replies; 31+ messages in thread
From: Pali Rohár @ 2013-11-20 13:30 UTC (permalink / raw)
  To: David Howells; +Cc: linux-afs, linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 817 bytes --]

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.

diff --git a/fs/afs/proc.c b/fs/afs/proc.c
index 526e4bb..276cb6e 100644
--- a/fs/afs/proc.c
+++ b/fs/afs/proc.c
@@ -147,11 +147,11 @@ int afs_proc_init(void)
 	if (!proc_afs)
 		goto error_dir;
 
-	p = proc_create("cells", 0, proc_afs, &afs_proc_cells_fops);
+	p = proc_create("cells", S_IFREG | S_IRUGO | S_IWUSR, proc_afs, &afs_proc_cells_fops);
 	if (!p)
 		goto error_cells;
 
-	p = proc_create("rootcell", 0, proc_afs, &afs_proc_rootcell_fops);
+	p = proc_create("rootcell", S_IFREG | S_IRUGO | S_IWUSR, proc_afs, &afs_proc_rootcell_fops);
 	if (!p)
 		goto error_rootcell;
 
-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

end of thread, other threads:[~2014-01-31  0:31 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-26 12:27 [PATCH] afs: proc cells and rootcell are writeable David Howells
2014-01-26 19:23 ` Linus Torvalds
2014-01-26 20:19   ` Ingo Molnar
2014-01-26 20:22     ` Ingo Molnar
2014-01-26 20:25     ` Ingo Molnar
2014-01-28  8:39       ` Geert Uytterhoeven
2014-01-28 12:04         ` Ingo Molnar
2014-01-28 12:17           ` Geert Uytterhoeven
2014-01-28 12:20             ` Ingo Molnar
2014-01-28 17:34             ` Joe Perches
2014-01-28 20:20 ` David Howells
2014-01-28 20:27   ` Al Viro
2014-01-28 20:56   ` David Howells
2014-01-30 21:48 ` Eric W. Biederman
2014-01-30 21:50   ` Linus Torvalds
2014-01-30 22:15     ` Pali Rohár
2014-01-30 22:27       ` Linus Torvalds
2014-01-30 22:36         ` Dave Jones
2014-01-30 22:33       ` Russ Allbery
2014-01-31  0:21   ` David Howells
2014-01-31  0:28   ` David Howells
2014-01-31  0:31   ` David Howells
2014-01-31  0:07 ` David Howells
2014-01-31  0:20 ` David Howells
  -- strict thread matches above, loose matches on Subject: below --
2014-01-27 12:33 Alexey Dobriyan
2013-11-20 13:30 Pali Rohár
2013-12-10  8:02 ` Pali Rohár
2013-12-16  7:00 ` Andrew Morton
2013-12-17 13:19   ` Pali Rohár
2013-12-17 18:31 ` David Howells
2013-12-31  9:59   ` Pali Rohár

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).