Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SGOKZ-0005Be-9O for mharc-grub-devel@gnu.org; Sat, 07 Apr 2012 01:36:59 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGOKW-0005BO-LJ for grub-devel@gnu.org; Sat, 07 Apr 2012 01:36:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SGOKU-0002JC-FI for grub-devel@gnu.org; Sat, 07 Apr 2012 01:36:56 -0400 Received: from che.mayfirst.org ([209.234.253.108]:44577) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGOKU-0002J1-BX for grub-devel@gnu.org; Sat, 07 Apr 2012 01:36:54 -0400 Received: from pip.fifthhorseman.net (lair.fifthhorseman.net [108.58.6.98]) by che.mayfirst.org (Postfix) with ESMTPSA id 7BD42F970 for ; Sat, 7 Apr 2012 01:36:50 -0400 (EDT) Received: by pip.fifthhorseman.net (Postfix, from userid 1000) id 7106F1187B; Sat, 7 Apr 2012 01:36:50 -0400 (EDT) From: Daniel Kahn Gillmor To: Grub 2 Development List Subject: grub.pxe, ARP-after-boot, DMA, and trouble User-Agent: Notmuch/0.12 (http://notmuchmail.org) Emacs/23.4.1 (i486-pc-linux-gnu) Date: Sat, 07 Apr 2012 01:36:44 -0400 Message-ID: <87sjggw1ar.fsf@pip.fifthhorseman.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 209.234.253.108 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Apr 2012 05:36:58 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I've been recently using grub.pxe (from debian's version 1.99-17) according to the instructions at [0] to boot memtest86+ [1] (from debian's version 4.20-1.1) over the network on x86 machines. Due to the problems described below, i'm using a serial console. The grub configuration is very simple: =2D------------------------- serial --speed=3D115200 terminal_input console serial terminal_output console serial menuentry 'memtest86+ serial console' { set root=3D'(pxe)' echo 'loading memory tester...' linux16 /memtest86+.bin console=3DttyS0,115200n8 } =2D------------------------- On some machines i've done this with, memtest86+ reports transient memory failures very early in the run, and the failures seem to happen even on brand new sticks of RAM, placed in any combination and order in the hardware. The errors were transient -- sometimes i'd get as many as ~300 32-bit words of RAM failing, other times memtest could complete a full pass with no errors. The failures came during an early test where memtest86+ writes each address's value to its own memory location, and then re-reads the memory to verify. Using the serial line, i was able to record the memory failures from a run that had 24 words fail. I was able to transcribe them and convert them to a hexdump format. These are the 24 words that failed (the memory address indices are in the left-hand column): * 00095d30 9c c8 e3 71 dc ff 00 65 32 4b a0 29 08 06 00 01 00095d40 08 00 06 04 00 01 00 65 32 4b a0 29 c0 a8 17 54 00095d50 00 00 00 00 00 00 c0 a8 17 86 55 55 55 55 55 55 00095d60 55 55 55 55 55 55 55 55 55 55 55 55 9a a2 8c 53 * 00097590 00 00 00 00 30 5d 09 00 40 00 00 00 04 00 00 00 000975a0 4d 4d 00 00 00 00 00 00 00 00 00 00 10 38 6a 94 * The first block (of 16 words) appears to be an ARP request packet From=20the local network's DHCP server to the failing machine (the MAC addresses have been obfuscated here, and i didn't bother updating the checksum to match) The second block (of 8 words) appears to contain a pointer to the first block, a size indicator, and some other stuff i don't recognize. So i think what's happening is something like Matthew Garrett describes in his recent work with UEFI [2], although i'm using BIOS and not UEFI. In particular, i suspect that *after* the bootloader has turned over control to the kernel (memtest in this case), the PXE-driven NIC is continuing to DMA received packets into active RAM. This seems pretty dangerous! Would using pxe_unload before the close of the stanza prevent this situation from happening (i regret i haven't been able to test it myself because i haven't had access to the failing hardware since i completed this diagnosis)? If so, it seems like that should be clearly documented and strongly recommended in grub.texi. Or, should grub be marking certain sections of memory as unavailable somehow before handoff to the kernel? Or is there some other way to avoid this sort of corruption? I've seen similar failures now on pretty different hardware (a fairly old Dell Optiplex GX260 SFF and a new Lenovo ThinkCentre M77). Any ideas? --dkg [0] https://www.gnu.org/software/grub/manual/grub.html#Network [1] http://www.memtest.org/ [2] http://mjg59.dreamwidth.org/11235.html --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQJ8BAEBCgBmBQJPf9JtXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQwRUU1QkU5NzkyODJEODBCOUY3NTQwRjFD Q0QyRUQ5NEQyMTczOUU5AAoJEMzS7ZTSFznp5MgQAKEXJlZt3J9Eh9tfy+Ts92eg ftCgjU7YQBwhVAZmEjnblS/Gapr4jJIxTDbtnUaHhGOJaeF/1Vzv1gX5CHO02sXa XQIYywc1S+eLDSA5NZBCB7GcKkECjT0Sn0IbHwspowWfIXOW7mc71uv4W6gXEnPq Wmpk4qq6p/qKk7syUJ9twMUfw3FMjiSwV+Uy0Z1tA8C82y5o2RmCWbe8LtwFJH/X nAuHniDfAIRTNhY2YBTywDezbmm9eOCea55wDnffHio1Oz9rtnddupbqHaARLGFd dQuo1GTkI1oPSLPZngUsXxvSzm+lkTtbspWmm3FbepFrFUVqvxPQ3OLt5/u3Qc7B iXMJskWA8JsOkudxx+Tf74usEkTu/w2Vv2CQ1kV5/oAbZGNq3McfUpZCLGj4fobz u1K4j25wOEYMeungl/M4mutM9zPfr4O3+SBcddk2pkpcJNUtgrgBbGhPZvMv9XvX 84cYC9wTA8Q/7BeK9ln1M3CnQrWY+7e6d2/+rzPLbJUN4o54rUJoD7iGF2h04jTU 4A1j15NnIsuUxCxPjPm2y1hz4L5kSA1Ueeqi6smJD3UYoHMsHSUkp8K0mvdJqlVg XIvFZYyQxJl8SrqHQz24fJV7RC/EKIHbUJ+6nMW+wtj84lWkvC+rTRgrl3HvC1X8 W0ztYR0KPD2YmWXtYA0K =Na2p -----END PGP SIGNATURE----- --=-=-=--