Opened 4 years ago
#19608 new defect
[Patch] Fixed BIOS int 13h, ah=48h
| Reported by: | jlxip | Owned by: | |
|---|---|---|---|
| Component: | other | Version: | VirtualBox 6.1.8 |
| Keywords: | bios, interrupt, 13h, 48h | Cc: | |
| Guest type: | all | Host type: | Linux |
Description
Patch for VirtualBox 6.1.8. Fixes an impossible condition in «edd_fill_dpt» function, which implements the function 48h of the BIOS interrupt 13h.
diff -ruN ./VirtualBox-6.1.8{.orig,}/src/VBox/Devices/PC/BIOS/disk.c
--- ./VirtualBox-6.1.8.orig/src/VBox/Devices/PC/BIOS/disk.c 2020-05-14 20:39:11.000000000 +0200
+++ ./VirtualBox-6.1.8/src/VBox/Devices/PC/BIOS/disk.c 2020-05-21 14:53:18.672394097 +0200
@@ -140,6 +140,7 @@
int edd_fill_dpt(dpt_t __far *dpt, bio_dsk_t __far *bios_dsk, uint8_t device)
{
uint16_t ebda_seg = read_word(0x0040,0x000E);
+ uint16_t new_dpt_size;
/* Check if buffer is large enough. */
if (dpt->size < 0x1a)
@@ -149,7 +150,7 @@
if (dpt->size >= 0x1a) {
uint64_t lba;
- dpt->size = 0x1a;
+ new_dpt_size = 0x1a;
dpt->blksize = bios_dsk->devices[device].blksize;
if (bios_dsk->devices[device].device == DSK_DEVICE_CDROM) {
@@ -175,7 +176,7 @@
uint8_t channel, irq, mode, checksum, i, xlation;
uint16_t iobase1, iobase2, options;
- dpt->size = 0x1e;
+ new_dpt_size = 0x1e;
dpt->dpte_segment = ebda_seg;
dpt->dpte_offset = (uint16_t)&EbdaData->bdisk.dpte;
@@ -227,7 +228,7 @@
iface = bios_dsk->channels[channel].iface;
iobase1 = bios_dsk->channels[channel].iobase1;
- dpt->size = 0x42;
+ new_dpt_size = 0x42;
dpt->key = 0xbedd;
dpt->dpi_length = 0x24;
dpt->reserved1 = 0;
@@ -269,6 +270,8 @@
checksum = -checksum;
dpt->checksum = checksum;
}
+
+ dpt->size = new_dpt_size;
return 0;
}
Attachments (1)
Note:
See TracTickets
for help on using tickets.


Patch file