x86: Fix out of bounds irq handlers access
PATCH 1/1 x86: Fix out of bounds irq handlers access
Using coreboot-x86_defconfig, the following error occurred prior to this modification:
CC arch/x86/lib/interruptsarch/x86/lib/interrupts.c: In function ?do_irqinfo?:arch/x86/lib/interrupts.c:134:24: error: iteration 16u invokes undefined behavior [-Werror=aggressive-loop-optimizations]
if (irq_handlers[irq].handler != NULL) {
^arch/x86/lib/interrupts.c:133:2: note: containing loop
for (irq = 0; irq <= CONFIG_SYS_NUM_IRQS; irq++) {
^
cc1: all warnings being treated as errors scripts/Makefile.build:275: recipe for target 'arch/x86/lib/interrupts.o' failed make[1]: *** [arch/x86/lib/interrupts.o] Error 1
Makefile:1093: recipe for target 'arch/x86/lib' failed
make: *** [arch/x86/lib] Error 2
--- arch/x86/lib/interrupts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/lib/interrupts.c +1 -1
@@ -130,7 +130,7 @@ int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])printf ("Interrupt-Information:\n" );printf ("Nr Routine Arg Count\n" ); -for (irq =0 ; irq <=CONFIG_SYS_NUM_IRQS ; irq++) { +for (irq =0 ; irq <CONFIG_SYS_NUM_IRQS ; irq++) {if (irq_handlers[irq].handler !=NULL ) { printf("%02d %08lx %08lx %d\n", irq,
Signature · 1 line
2.0.0
PATCH 1/1 x86: Fix out of bounds irq handlers access
Quoted 15 lines · Sebastien Ronsse
Using coreboot-x86_defconfig, the following error occurred prior to this modification:
CCarch/x86/lib/interruptsarch/x86/lib/interrupts.c: In function ?do_irqinfo?:arch/x86/lib/interrupts.c:134:24: error: iteration 16u invokes undefined behavior [-Werror=aggressive-loop-optimizations]if (irq_handlers[irq].handler != NULL) { ^
arch/x86/lib/interrupts.c:133:2: note: containing loop
for (irq = 0; irq <=CONFIG_SYS_NUM_IRQS; irq++) {
^
cc1: all warnings being treated as errorsscripts/Makefile.build:275: recipe for target 'arch/x86/lib/interrupts.o' failed make[1]: *** [arch/x86/lib/interrupts.o] Error 1
Makefile:1093: recipe for target 'arch/x86/lib' failed
make: *** [arch/x86/lib] Error 2
Quoted 4 lines
Signed-off-by Sebastien Ronsse <[email protected]>--- arch/x86/lib/interrupts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks!
Also for reference:
https://chromium-review.googlesource.com/#/c/218562/
Quoted 15 lines
arch/x86/lib/interrupts.c +1
-2@@ -130,7 +130,7 @@ int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])printf ("Interrupt-Information:\n" );printf ("Nr Routine Arg Count\n" ); -for (irq =0 ; irq <=CONFIG_SYS_NUM_IRQS ; irq++) { +for (irq =0 ; irq <CONFIG_SYS_NUM_IRQS ; irq++) {if (irq_handlers[irq].handler !=NULL ) { printf("%02d %08lx %08lx %d\n", irq, --
Quoted 2 lines
2.0.0
Regards,
Simon
PATCH 1/1 x86: Fix out of bounds irq handlers access
Quoted 21 lines · Simon Glass
Quoted 15 lines · Sebastien Ronsse
Using coreboot-x86_defconfig, the following error occurred prior to this modification:
CCarch/x86/lib/interruptsarch/x86/lib/interrupts.c: In function ?do_irqinfo?:arch/x86/lib/interrupts.c:134:24: error: iteration 16u invokes undefined behavior [-Werror=aggressive-loop-optimizations]if (irq_handlers[irq].handler != NULL) { ^
arch/x86/lib/interrupts.c:133:2: note: containing loop
for (irq = 0; irq <=CONFIG_SYS_NUM_IRQS; irq++) {
^
cc1: all warnings being treated as errorsscripts/Makefile.build:275: recipe for target 'arch/x86/lib/interrupts.o' failed make[1]: *** [arch/x86/lib/interrupts.o] Error 1
Makefile:1093: recipe for target 'arch/x86/lib' failed
make: *** [arch/x86/lib] Error 2Quoted 4 lines
Signed-off-by Sebastien Ronsse <[email protected]>--- arch/x86/lib/interrupts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 7 lines
Thanks!
Acked-by Simon Glass <[email protected]>Also for reference:
Applied to u-boot-x86, thanks!