LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* 2.6.28-rc3: usb_hcd_poll_rh_status: array subscript is above array bounds
@ 2008-11-03 8:10 Andrey Borzenkov
2008-11-03 14:53 ` Alan Stern
0 siblings, 1 reply; 5+ messages in thread
From: Andrey Borzenkov @ 2008-11-03 8:10 UTC (permalink / raw)
To: USB list; +Cc: Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 335 bytes --]
CC [M] drivers/usb/core/hcd.o
/home/bor/src/linux-git/drivers/usb/core/hcd.c: In function ‘usb_hcd_poll_rh_status’:
/home/bor/src/linux-git/arch/x86/include/asm/string_32.h:75: warning: array subscript is above array bounds
It is likely that issue is actually in string_32.h as similar errors are
in oher places as well.
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 2.6.28-rc3: usb_hcd_poll_rh_status: array subscript is above array bounds
2008-11-03 8:10 2.6.28-rc3: usb_hcd_poll_rh_status: array subscript is above array bounds Andrey Borzenkov
@ 2008-11-03 14:53 ` Alan Stern
2008-11-04 16:01 ` Andrey Borzenkov
0 siblings, 1 reply; 5+ messages in thread
From: Alan Stern @ 2008-11-03 14:53 UTC (permalink / raw)
To: Andrey Borzenkov; +Cc: USB list, Linux Kernel Mailing List
On Mon, 3 Nov 2008, Andrey Borzenkov wrote:
> CC [M] drivers/usb/core/hcd.o
> /home/bor/src/linux-git/drivers/usb/core/hcd.c: In function âusb_hcd_poll_rh_statusâ:
> /home/bor/src/linux-git/arch/x86/include/asm/string_32.h:75: warning: array subscript is above array bounds
>
> It is likely that issue is actually in string_32.h as similar errors are
> in oher places as well.
I think this is actually a compiler bug. It certainly has nothing to
do with USB. There was a discussion about it a month or so ago on
LKML.
Alan Stern
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 2.6.28-rc3: usb_hcd_poll_rh_status: array subscript is above array bounds
2008-11-03 14:53 ` Alan Stern
@ 2008-11-04 16:01 ` Andrey Borzenkov
2008-11-04 16:10 ` Alan Stern
0 siblings, 1 reply; 5+ messages in thread
From: Andrey Borzenkov @ 2008-11-04 16:01 UTC (permalink / raw)
To: Alan Stern; +Cc: USB list, Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 1048 bytes --]
On Monday 03 November 2008, Alan Stern wrote:
> On Mon, 3 Nov 2008, Andrey Borzenkov wrote:
>
> > CC [M] drivers/usb/core/hcd.o
> > /home/bor/src/linux-git/drivers/usb/core/hcd.c: In function âusb_hcd_poll_rh_statusâ:
> > /home/bor/src/linux-git/arch/x86/include/asm/string_32.h:75: warning: array subscript is above array bounds
> >
> > It is likely that issue is actually in string_32.h as similar errors are
> > in oher places as well.
>
> I think this is actually a compiler bug. It certainly has nothing to
> do with USB. There was a discussion about it a month or so ago on
> LKML.
>
Yes this really looks like a compiler bug, "length" hardly can be considered
constant expression even using very broad definition of "constant".
What is interesting though, it appears that compiler believes length has
value of 5. So it will copy one extra byte; and possibly pass incorrect
length to the caller. I cannot judge whether this garbage can do any harm.
Dp you know if it was ever reported to gcc folks?
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 2.6.28-rc3: usb_hcd_poll_rh_status: array subscript is above array bounds
2008-11-04 16:01 ` Andrey Borzenkov
@ 2008-11-04 16:10 ` Alan Stern
2008-11-04 16:21 ` Arjan van de Ven
0 siblings, 1 reply; 5+ messages in thread
From: Alan Stern @ 2008-11-04 16:10 UTC (permalink / raw)
To: Andrey Borzenkov; +Cc: USB list, Linux Kernel Mailing List
On Tue, 4 Nov 2008, Andrey Borzenkov wrote:
> > I think this is actually a compiler bug. It certainly has nothing to
> > do with USB. There was a discussion about it a month or so ago on
> > LKML.
> >
>
>
>
> Yes this really looks like a compiler bug, "length" hardly can be considered
> constant expression even using very broad definition of "constant".
>
> What is interesting though, it appears that compiler believes length has
> value of 5. So it will copy one extra byte; and possibly pass incorrect
> length to the caller. I cannot judge whether this garbage can do any harm.
Did you examine the object code? That's the only way to be sure.
> Dp you know if it was ever reported to gcc folks?
I have no idea. All I know is what was reported on LKML.
Alan Stern
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 2.6.28-rc3: usb_hcd_poll_rh_status: array subscript is above array bounds
2008-11-04 16:10 ` Alan Stern
@ 2008-11-04 16:21 ` Arjan van de Ven
0 siblings, 0 replies; 5+ messages in thread
From: Arjan van de Ven @ 2008-11-04 16:21 UTC (permalink / raw)
To: Alan Stern; +Cc: Andrey Borzenkov, USB list, Linux Kernel Mailing List
On Tue, 4 Nov 2008 11:10:33 -0500 (EST)
Alan Stern <stern@rowland.harvard.edu> wrote:
> > Dp you know if it was ever reported to gcc folks?
>
> I have no idea. All I know is what was reported on LKML.
I reported this bug (well from a different part of the kernel, but same
warning) to gcc and yes it's a "gcc behavior"
apparently they produce the warning in a phase of the compiler before
the optimization to remove this code as "not taken".
There's a fix floating around but it's only a partial fix or something
like that.
--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-11-04 16:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-03 8:10 2.6.28-rc3: usb_hcd_poll_rh_status: array subscript is above array bounds Andrey Borzenkov
2008-11-03 14:53 ` Alan Stern
2008-11-04 16:01 ` Andrey Borzenkov
2008-11-04 16:10 ` Alan Stern
2008-11-04 16:21 ` Arjan van de Ven
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).