linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG -next] in pcmcia: use struct resource for PCMCIA devices, part 2
@ 2010-08-02 23:53 Christoph Fritz
  2010-08-03  6:12 ` Dominik Brodowski
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Fritz @ 2010-08-02 23:53 UTC (permalink / raw)
  To: Dominik Brodowski; +Cc: linux-next

Hi,

 buffer overflow in next-tree's commit 810654b4119fd8c6ce03ffeb4b78f0ff8ffe0559

drivers/pcmcia/ds.c
  555         for (i = 0; i < (MAX_IO_WIN + MAX_WIN); i++) {                                                                             
  556             c->io[i].name = p_dev->devname;                                                                                        

with 'io' only defined to MAX_IO_WIN

drivers/pcmcia/cs_internal.h
  42     struct resource io[MAX_IO_WIN]; /* io ports */                                                                        

non-tested fix:

diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h
index da055dc..d14c6ec 100644
--- a/drivers/pcmcia/cs_internal.h
+++ b/drivers/pcmcia/cs_internal.h
@@ -39,7 +39,7 @@ typedef struct config_t {
 	unsigned char	Status, Pin, Copy, Option, ExtStatus;
 	unsigned int	CardValues;
 
-	struct resource io[MAX_IO_WIN]; /* io ports */
+	struct resource io[MAX_IO_WIN + MAX_WIN]; /* io ports */
 	struct resource mem[MAX_WIN];   /* mem areas */
 
 	struct {

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

* Re: [BUG -next] in pcmcia: use struct resource for PCMCIA devices, part 2
  2010-08-02 23:53 [BUG -next] in pcmcia: use struct resource for PCMCIA devices, part 2 Christoph Fritz
@ 2010-08-03  6:12 ` Dominik Brodowski
  2010-08-03 10:16   ` Christoph Fritz
  0 siblings, 1 reply; 3+ messages in thread
From: Dominik Brodowski @ 2010-08-03  6:12 UTC (permalink / raw)
  To: Christoph Fritz; +Cc: linux-next

Hey,

On Tue, Aug 03, 2010 at 01:53:21AM +0200, Christoph Fritz wrote:
> drivers/pcmcia/ds.c
>   555         for (i = 0; i < (MAX_IO_WIN + MAX_WIN); i++) {                                                                             
>   556             c->io[i].name = p_dev->devname;                                                                                        
> 
> with 'io' only defined to MAX_IO_WIN
> 
> drivers/pcmcia/cs_internal.h
>   42     struct resource io[MAX_IO_WIN]; /* io ports */                                                                        

Yes, this is ugly (and will be fixed right now), but it isn't really a bug,
for we want c->mem[i].name to be set too, and c->mem[] follows immediately
c->io[] and is sufficientyly large.

Best,
	Dominik

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

* Re: [BUG -next] in pcmcia: use struct resource for PCMCIA devices, part 2
  2010-08-03  6:12 ` Dominik Brodowski
@ 2010-08-03 10:16   ` Christoph Fritz
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Fritz @ 2010-08-03 10:16 UTC (permalink / raw)
  To: Dominik Brodowski; +Cc: linux-next

On Tue, 2010-08-03 at 08:12 +0200, Dominik Brodowski wrote:
> Hey,
> 
> On Tue, Aug 03, 2010 at 01:53:21AM +0200, Christoph Fritz wrote:
> > drivers/pcmcia/ds.c
> >   555         for (i = 0; i < (MAX_IO_WIN + MAX_WIN); i++) {                                                                             
> >   556             c->io[i].name = p_dev->devname;                                                                                        
> > 
> > with 'io' only defined to MAX_IO_WIN
> > 
> > drivers/pcmcia/cs_internal.h
> >   42     struct resource io[MAX_IO_WIN]; /* io ports */                                                                        
> 
> Yes, this is ugly (and will be fixed right now), but it isn't really a bug,
> for we want c->mem[i].name to be set too, and c->mem[] follows immediately
> c->io[] and is sufficientyly large.

ah I see ;-)

 thanks,
   chf

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

end of thread, other threads:[~2010-08-03 10:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-02 23:53 [BUG -next] in pcmcia: use struct resource for PCMCIA devices, part 2 Christoph Fritz
2010-08-03  6:12 ` Dominik Brodowski
2010-08-03 10:16   ` Christoph Fritz

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