>Number: 176748 >Category: kern >Synopsis: BTX Loader i386 incorrectly probes EDD, possibly resulting >division by zero >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Mar 08 13:40:01 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Arrigo Marchiori >Release: 9-STABLE >Organization: >Environment: FreeBSD myhost 9.1-STABLE FreeBSD 9.1-STABLE #19 r247772: Mon Mar 4 10:47:30 CET 2013 root@myhost:/usr/obj/usr/src/sys/GENERIC i386 >Description: BTX probes for disk drives using interrupt 0x13. The "EDD" information is parsed incorrectly: the loader may incorrectly assume that the EDD information is present, and therefore overwrite the number of sectors and their size with incorrect values.
The error is in file /usr/src/sys/boot/i386/libi386/biosdisk.c, inside function bd_int13probe(). The call to interrupt 0x13, AH=0x41 returns values in the bits of the CX register. The bit EDD_INTERFACE_EDD is not checked, while it should be. The effect on my configuration was that bd_int13probe() incorrectly assumed that EDD information was present; it requested for it with int 0x13, AH=0x48 and overwrote the number and size of sectors with invalid values (zero, in my case). This resulted in a zero by zero division in file /usr/src/sys/boot/i386/common/disk.c, function disk_open(). My setup had some buildworld/buildkernel tunings through src.conf(5). For instance, ZFS support was not compiled in. I believe such customization should not influence this particular problem. >How-To-Repeat: Find a system with a mass memory that does not provide EDD information. This problem was detected on a AMD Geode GX CPU, using a USB drive for boot. Please let me know if you need any more information about this. >Fix: The attached patch adds the check for the EDD_INTERFACE_EDD bit inside the data returned by the call to interrupt 0x13, AH=0x41. It solves the problem on my hardware configuration. Patch attached with submission follows: Index: biosdisk.c =================================================================== --- biosdisk.c (revisione 247767) +++ biosdisk.c (copia locale) @@ -231,7 +231,8 @@ v86int(); if (V86_CY(v86.efl) || /* carry set */ (v86.ebx & 0xffff) != 0xaa55 || /* signature */ - (v86.ecx & EDD_INTERFACE_FIXED_DISK) == 0) + (v86.ecx & EDD_INTERFACE_FIXED_DISK) == 0 || + (v86.ecx & EDD_INTERFACE_EDD) == 0) return (1); /* EDD supported */ bd->bd_flags |= BD_MODEEDD1; >Release-Note: >Audit-Trail: >Unformatted: _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"