From: Nathan Lynch <nathanl@austin.ibm.com>

proc_create() needs to check that the name of an entry to be created does
not contain a '/' character.

To test, I hacked the ibmveth driver to try to call request_irq with a
bogus "foo/bar" devname.  The creation of the /proc/irq/1234/xxx entry
silently fails, as intended.  Perhaps the irq code should be made to check
for the failure.

Signed-off-by: Nathan Lynch <nathanl@austin.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/proc/generic.c |    5 +++++
 1 files changed, 5 insertions(+)

diff -puN fs/proc/generic.c~prohibit-slash-in-proc-directory-entry-names fs/proc/generic.c
--- 25/fs/proc/generic.c~prohibit-slash-in-proc-directory-entry-names	2005-01-05 16:02:39.663400232 -0800
+++ 25-akpm/fs/proc/generic.c	2005-01-05 16:02:39.667399624 -0800
@@ -551,6 +551,11 @@ static struct proc_dir_entry *proc_creat
 
 	if (!(*parent) && xlate_proc_name(name, parent, &fn) != 0)
 		goto out;
+
+	/* At this point there must not be any '/' characters beyond *fn */
+	if (strchr(fn, '/'))
+		goto out;
+
 	len = strlen(fn);
 
 	ent = kmalloc(sizeof(struct proc_dir_entry) + len + 1, GFP_KERNEL);
_