linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] request_irq: avoid slash in proc directory entries
@ 2005-01-05  7:53 Olaf Hering
  2005-01-05  8:01 ` Andrew Morton
  2005-01-05 12:37 ` [PATCH] request_irq: avoid slash in proc directory entries Alan Cox
  0 siblings, 2 replies; 8+ messages in thread
From: Olaf Hering @ 2005-01-05  7:53 UTC (permalink / raw)
  To: linux-kernel, Andrew Morton


A few users of request_irq pass a string with '/'.
As a result, ls -l /proc/irq/*/* will fail to list these entries.

 drivers/input/serio/maceps2.c     |    2 +-
 drivers/macintosh/via-pmu.c       |    2 +-
 drivers/net/wan/hostess_sv11.c    |    2 +-
 include/asm-sh/mpc1211/keyboard.h |    2 +-
 include/asm-sh64/keyboard.h       |    2 +-
 sound/isa/opl3sa2.c               |    2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)


Signed-off-by: Olaf Hering <olh@suse.de>

diff -purNx tags linux-2.6.10.orig/drivers/input/serio/maceps2.c linux-2.6.10-olh/drivers/input/serio/maceps2.c
--- linux-2.6.10.orig/drivers/input/serio/maceps2.c	2004-12-31 09:28:47.000000000 +0100
+++ linux-2.6.10-olh/drivers/input/serio/maceps2.c	2005-01-01 19:34:58.000000000 +0100
@@ -90,7 +90,7 @@ static int maceps2_open(struct serio *de
 {
 	struct maceps2_data *data = (struct maceps2_data *)dev->port_data;
 
-	if (request_irq(data->irq, maceps2_interrupt, 0, "PS/2 port", dev)) {
+	if (request_irq(data->irq, maceps2_interrupt, 0, "PS2 port", dev)) {
 		printk(KERN_ERR "Could not allocate PS/2 IRQ\n");
 		return -EBUSY;
 	}
diff -purNx tags linux-2.6.10.orig/drivers/macintosh/via-pmu.c linux-2.6.10-olh/drivers/macintosh/via-pmu.c
--- linux-2.6.10.orig/drivers/macintosh/via-pmu.c	2004-12-31 09:29:17.000000000 +0100
+++ linux-2.6.10-olh/drivers/macintosh/via-pmu.c	2005-01-01 19:30:45.000000000 +0100
@@ -418,7 +418,7 @@ static int __init via_pmu_start(void)
 	}
 
 	if (pmu_kind == PMU_KEYLARGO_BASED && gpio_irq != -1) {
-		if (request_irq(gpio_irq, gpio1_interrupt, 0, "GPIO1/ADB", (void *)0))
+		if (request_irq(gpio_irq, gpio1_interrupt, 0, "GPIO1-ADB", (void *)0))
 			printk(KERN_ERR "pmu: can't get irq %d (GPIO1)\n", gpio_irq);
 		gpio_irq_enabled = 1;
 	}
diff -purNx tags linux-2.6.10.orig/drivers/net/wan/hostess_sv11.c linux-2.6.10-olh/drivers/net/wan/hostess_sv11.c
--- linux-2.6.10.orig/drivers/net/wan/hostess_sv11.c	2004-08-14 07:37:27.000000000 +0200
+++ linux-2.6.10-olh/drivers/net/wan/hostess_sv11.c	2005-01-01 19:34:46.000000000 +0100
@@ -263,7 +263,7 @@ static struct sv11_device *sv11_init(int
 	/* We want a fast IRQ for this device. Actually we'd like an even faster
 	   IRQ ;) - This is one driver RtLinux is made for */
 	   
-	if(request_irq(irq, &z8530_interrupt, SA_INTERRUPT, "Hostess SV/11", dev)<0)
+	if(request_irq(irq, &z8530_interrupt, SA_INTERRUPT, "Hostess SV-11", dev)<0)
 	{
 		printk(KERN_WARNING "hostess: IRQ %d already in use.\n", irq);
 		goto fail1;
diff -purNx tags linux-2.6.10.orig/include/asm-sh/mpc1211/keyboard.h linux-2.6.10-olh/include/asm-sh/mpc1211/keyboard.h
--- linux-2.6.10.orig/include/asm-sh/mpc1211/keyboard.h	2004-08-14 07:36:58.000000000 +0200
+++ linux-2.6.10-olh/include/asm-sh/mpc1211/keyboard.h	2005-01-01 19:35:52.000000000 +0100
@@ -57,7 +57,7 @@ extern unsigned char pckbd_sysrq_xlate[1
 #define AUX_IRQ 12
 
 #define aux_request_irq(hand, dev_id)					\
-	request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS/2 Mouse", dev_id)
+	request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS2 Mouse", dev_id)
 
 #define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id)
 
diff -purNx tags linux-2.6.10.orig/include/asm-sh64/keyboard.h linux-2.6.10-olh/include/asm-sh64/keyboard.h
--- linux-2.6.10.orig/include/asm-sh64/keyboard.h	2004-08-14 07:36:44.000000000 +0200
+++ linux-2.6.10-olh/include/asm-sh64/keyboard.h	2005-01-01 19:36:07.000000000 +0100
@@ -65,7 +65,7 @@ extern unsigned char pckbd_sysrq_xlate[1
 #endif
 
 #define aux_request_irq(hand, dev_id)					\
-	request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS/2 Mouse", dev_id)
+	request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS2 Mouse", dev_id)
 
 #define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id)
 
diff -purNx tags linux-2.6.10.orig/sound/isa/opl3sa2.c linux-2.6.10-olh/sound/isa/opl3sa2.c
--- linux-2.6.10.orig/sound/isa/opl3sa2.c	2004-12-31 09:29:29.000000000 +0100
+++ linux-2.6.10-olh/sound/isa/opl3sa2.c	2005-01-01 19:35:34.000000000 +0100
@@ -713,7 +713,7 @@ static int __devinit snd_opl3sa2_probe(i
 		chip->single_dma = 1;
 	if ((err = snd_opl3sa2_detect(chip)) < 0)
 		goto __error;
-	if (request_irq(xirq, snd_opl3sa2_interrupt, SA_INTERRUPT, "OPL3-SA2/3", (void *)chip)) {
+	if (request_irq(xirq, snd_opl3sa2_interrupt, SA_INTERRUPT, "OPL3-SA2", (void *)chip)) {
 		snd_printk(KERN_ERR "opl3sa2: can't grab IRQ %d\n", xirq);
 		err = -ENODEV;
 		goto __error;

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

* Re: [PATCH] request_irq: avoid slash in proc directory entries
  2005-01-05  7:53 [PATCH] request_irq: avoid slash in proc directory entries Olaf Hering
@ 2005-01-05  8:01 ` Andrew Morton
  2005-01-05  9:34   ` Olaf Hering
  2005-01-05 19:22   ` [PATCH] prohibit slash in proc directory entry names Nathan Lynch
  2005-01-05 12:37 ` [PATCH] request_irq: avoid slash in proc directory entries Alan Cox
  1 sibling, 2 replies; 8+ messages in thread
From: Andrew Morton @ 2005-01-05  8:01 UTC (permalink / raw)
  To: Olaf Hering; +Cc: linux-kernel

Olaf Hering <olh@suse.de> wrote:
>
> A few users of request_irq pass a string with '/'.
>  As a result, ls -l /proc/irq/*/* will fail to list these entries.

hrm, interesting.  So how do these entries appear in /proc?  Do they
actually have slashes in them?

I get the feeling that something somewhere should be detecting this and
should be propagating an error back.

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

* Re: [PATCH] request_irq: avoid slash in proc directory entries
  2005-01-05  8:01 ` Andrew Morton
@ 2005-01-05  9:34   ` Olaf Hering
  2005-01-05 19:22   ` [PATCH] prohibit slash in proc directory entry names Nathan Lynch
  1 sibling, 0 replies; 8+ messages in thread
From: Olaf Hering @ 2005-01-05  9:34 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

 On Wed, Jan 05, Andrew Morton wrote:

> Olaf Hering <olh@suse.de> wrote:
> >
> > A few users of request_irq pass a string with '/'.
> >  As a result, ls -l /proc/irq/*/* will fail to list these entries.
> 
> hrm, interesting.  So how do these entries appear in /proc?  Do they
> actually have slashes in them?

Yes, ls /proc/irq/*/* works, but ls -l does not because you have to
stat() the entry. I havent looked in detail, just poked around in /proc.

> I get the feeling that something somewhere should be detecting this and
> should be propagating an error back.

Yeah, a quick sanity check for procfile creation would be a good thing.

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

* Re: [PATCH] request_irq: avoid slash in proc directory entries
  2005-01-05  7:53 [PATCH] request_irq: avoid slash in proc directory entries Olaf Hering
  2005-01-05  8:01 ` Andrew Morton
@ 2005-01-05 12:37 ` Alan Cox
  2005-01-05 13:53   ` Olaf Hering
  1 sibling, 1 reply; 8+ messages in thread
From: Alan Cox @ 2005-01-05 12:37 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Linux Kernel Mailing List, Andrew Morton

On Mer, 2005-01-05 at 07:53, Olaf Hering wrote:
> diff -purNx tags linux-2.6.10.orig/drivers/net/wan/hostess_sv11.c linux-2.6.10-olh/drivers/net/wan/hostess_sv11.c
> --- linux-2.6.10.orig/drivers/net/wan/hostess_sv11.c	2004-08-14 07:37:27.000000000 +0200
> +++ linux-2.6.10-olh/drivers/net/wan/hostess_sv11.c	2005-01-01 19:34:46.000000000 +0100
> @@ -263,7 +263,7 @@ static struct sv11_device *sv11_init(int
>  	/* We want a fast IRQ for this device. Actually we'd like an even faster
>  	   IRQ ;) - This is one driver RtLinux is made for */
>  	   
> -	if(request_irq(irq, &z8530_interrupt, SA_INTERRUPT, "Hostess SV/11", dev)<0)
> +	if(request_irq(irq, &z8530_interrupt, SA_INTERRUPT, "Hostess SV-11", dev)<0)
>  	{
>  		printk(KERN_WARNING "hostess: IRQ %d already in use.\n", irq);
>  		goto fail1;

SV11 would probably be better but fine by me as the sv11 author


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

* Re: [PATCH] request_irq: avoid slash in proc directory entries
  2005-01-05 12:37 ` [PATCH] request_irq: avoid slash in proc directory entries Alan Cox
@ 2005-01-05 13:53   ` Olaf Hering
  0 siblings, 0 replies; 8+ messages in thread
From: Olaf Hering @ 2005-01-05 13:53 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linux Kernel Mailing List, Andrew Morton

 On Wed, Jan 05, Alan Cox wrote:

> On Mer, 2005-01-05 at 07:53, Olaf Hering wrote:
> > diff -purNx tags linux-2.6.10.orig/drivers/net/wan/hostess_sv11.c linux-2.6.10-olh/drivers/net/wan/hostess_sv11.c
> > --- linux-2.6.10.orig/drivers/net/wan/hostess_sv11.c	2004-08-14 07:37:27.000000000 +0200
> > +++ linux-2.6.10-olh/drivers/net/wan/hostess_sv11.c	2005-01-01 19:34:46.000000000 +0100
> > @@ -263,7 +263,7 @@ static struct sv11_device *sv11_init(int
> >  	/* We want a fast IRQ for this device. Actually we'd like an even faster
> >  	   IRQ ;) - This is one driver RtLinux is made for */
> >  	   
> > -	if(request_irq(irq, &z8530_interrupt, SA_INTERRUPT, "Hostess SV/11", dev)<0)
> > +	if(request_irq(irq, &z8530_interrupt, SA_INTERRUPT, "Hostess SV-11", dev)<0)
> >  	{
> >  		printk(KERN_WARNING "hostess: IRQ %d already in use.\n", irq);
> >  		goto fail1;
> 
> SV11 would probably be better but fine by me as the sv11 author

Ok, and GPIO1-ADB could be 'GPIO1 ADB'. Andrew, want a new patch?

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

* [PATCH] prohibit slash in proc directory entry names
  2005-01-05  8:01 ` Andrew Morton
  2005-01-05  9:34   ` Olaf Hering
@ 2005-01-05 19:22   ` Nathan Lynch
  2005-01-06  0:07     ` Andrew Morton
  1 sibling, 1 reply; 8+ messages in thread
From: Nathan Lynch @ 2005-01-05 19:22 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Olaf Hering, lkml

On Wed, 2005-01-05 at 02:01, Andrew Morton wrote:
> Olaf Hering <olh@suse.de> wrote:
> >
> > A few users of request_irq pass a string with '/'.
> >  As a result, ls -l /proc/irq/*/* will fail to list these entries.
> 
> hrm, interesting.  So how do these entries appear in /proc?  Do they
> actually have slashes in them?
> 
> I get the feeling that something somewhere should be detecting this and
> should be propagating an error back.

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>

Index: 2.6.10/fs/proc/generic.c
===================================================================
--- 2.6.10.orig/fs/proc/generic.c	2004-12-24 21:35:40.000000000 +0000
+++ 2.6.10/fs/proc/generic.c	2005-01-05 18:44:56.000000000 +0000
@@ -551,6 +551,11 @@
 
 	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);



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

* Re: [PATCH] prohibit slash in proc directory entry names
  2005-01-05 19:22   ` [PATCH] prohibit slash in proc directory entry names Nathan Lynch
@ 2005-01-06  0:07     ` Andrew Morton
  2005-01-06  0:12       ` Nathan Lynch
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2005-01-06  0:07 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: olh, linux-kernel

Nathan Lynch <nathanl@austin.ibm.com> wrote:
>
> 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>
> 
>  Index: 2.6.10/fs/proc/generic.c
>  ===================================================================
>  --- 2.6.10.orig/fs/proc/generic.c	2004-12-24 21:35:40.000000000 +0000
>  +++ 2.6.10/fs/proc/generic.c	2005-01-05 18:44:56.000000000 +0000
>  @@ -551,6 +551,11 @@
>   
>   	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;
>  +

hm.  From a brief code-squint I don't see how the string can ever have a
slash in it by this stage.  Unless the caller provided a non-null *parent
and we never called xlate_proc_name()?

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

* Re: [PATCH] prohibit slash in proc directory entry names
  2005-01-06  0:07     ` Andrew Morton
@ 2005-01-06  0:12       ` Nathan Lynch
  0 siblings, 0 replies; 8+ messages in thread
From: Nathan Lynch @ 2005-01-06  0:12 UTC (permalink / raw)
  To: Andrew Morton; +Cc: olh, linux-kernel

On Wed, 2005-01-05 at 16:07 -0800, Andrew Morton wrote:
> Nathan Lynch <nathanl@austin.ibm.com> wrote:
> >
> > 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>
> > 
> >  Index: 2.6.10/fs/proc/generic.c
> >  ===================================================================
> >  --- 2.6.10.orig/fs/proc/generic.c	2004-12-24 21:35:40.000000000 +0000
> >  +++ 2.6.10/fs/proc/generic.c	2005-01-05 18:44:56.000000000 +0000
> >  @@ -551,6 +551,11 @@
> >   
> >   	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;
> >  +
> 
> hm.  From a brief code-squint I don't see how the string can ever have a
> slash in it by this stage.  Unless the caller provided a non-null *parent
> and we never called xlate_proc_name()?

Right.



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

end of thread, other threads:[~2005-01-06  0:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-05  7:53 [PATCH] request_irq: avoid slash in proc directory entries Olaf Hering
2005-01-05  8:01 ` Andrew Morton
2005-01-05  9:34   ` Olaf Hering
2005-01-05 19:22   ` [PATCH] prohibit slash in proc directory entry names Nathan Lynch
2005-01-06  0:07     ` Andrew Morton
2005-01-06  0:12       ` Nathan Lynch
2005-01-05 12:37 ` [PATCH] request_irq: avoid slash in proc directory entries Alan Cox
2005-01-05 13:53   ` Olaf Hering

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