Re: [kvm-unit-tests PATCH] fix a arrayIndexOutOfBounds in function init_apic_map, online_cpus[i / 8] when i in 248...254.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22/12/2020 14.00, Xinpeng Liu wrote:
refer to x86/cstart64.S:online_cpus:.fill (max_cpus + 7) / 8, 1, 0

Signed-off-by: Xinpeng Liu <liuxp11@xxxxxxxxxxxxxxx>
---
  lib/x86/apic.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/x86/apic.c b/lib/x86/apic.c
index f43e9ef..da8f301 100644
--- a/lib/x86/apic.c
+++ b/lib/x86/apic.c
@@ -232,7 +232,7 @@ void mask_pic_interrupts(void)
      outb(0xff, 0xa1);
  }
-extern unsigned char online_cpus[MAX_TEST_CPUS / 8];
+extern unsigned char online_cpus[(MAX_TEST_CPUS + 7) / 8];

According to apic-defs.h, MAX_TEST_CPUS is set to 255, so this makes sense, indeed!

Reviewed-by: Thomas Huth <thuth@xxxxxxxxxx>




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux