mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-23 14:51:31 +02:00
x86: Correct copying of BIOS mode information
This is copying beyond the end of the destination buffer. Correct the code by using the size of the vesa_mode_info struct. We don't need to copy the rest of the bytes in the buffer. This long-standing bug prevents virtio bootdevs working correctly on qemu-x86 at present. Fixes: 0ca2426beae ("x86: Add support for running option ROMs natively") Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> # qemu-x86_64
This commit is contained in:
parent
1fa64e155d
commit
4099df48a6
@ -204,7 +204,7 @@ static u8 vbe_get_mode_info(struct vesa_state *mi)
|
|||||||
|
|
||||||
realmode_interrupt(0x10, VESA_GET_MODE_INFO, 0x0000, mi->video_mode,
|
realmode_interrupt(0x10, VESA_GET_MODE_INFO, 0x0000, mi->video_mode,
|
||||||
0x0000, buffer_seg, buffer_adr);
|
0x0000, buffer_seg, buffer_adr);
|
||||||
memcpy(mi->mode_info_block, buffer, sizeof(struct vesa_state));
|
memcpy(mi->mode_info_block, buffer, sizeof(struct vesa_mode_info));
|
||||||
mi->valid = true;
|
mi->valid = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user