david/ipxe
Archived
1
0
This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
ipxe/src
Michael Brown 00ff3d8bb3 [libc] Fix typo in longjmp()
Commit 8ab4b00 ("[libc] Rewrite setjmp() and longjmp()") introduced a
regression in which the saved values of %ebx, %esi, and %edi were all
accidentally restored into %esp.  The result is that the second and
subsequent returns from setjmp() would effectively corrupt %ebx, %esi,
%edi, and the stack pointer %esp.

Use of setjmp() and longjmp() is generally discouraged: our only use
occurs as part of the implementation of PXENV_RESTART_TFTP, since the
PXE API effectively mandates its use here.  The call to setjmp()
occurs at the start of pxe_start_nbp(), where there are almost
certainly no values held in %ebx, %esi, or %edi.  The corruption of
these registers therefore had no visible effect on program execution.
The corruption of %esp would have been visible on return from
pxe_start_nbp(), but there are no known PXE NBPs which first call
PXENV_RESTART_TFTP and subsequently attempt to return to the PXE base
code.  The effect on program execution was therefore similar to that
of moving the stack to a pseudo-random location in the 32-bit address
space; this will often allow execution to complete successfully since
there is a high chance that the pseudo-random location will be unused.
The regression therefore went undetected for around one month.

Fix by restoring the correct registers from the saved jmp_buf
structure.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-07 06:40:34 +01:00
..
arch [libc] Fix typo in longjmp() 2015-04-07 06:40:34 +01:00
bin Rename .cvsignore files to .gitignore 2007-06-09 22:57:00 +01:00
config [ehci] Add support for EHCI host controllers 2015-03-18 12:35:17 +00:00
core [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-05 11:40:13 +00:00
crypto [build] Fix the REQUIRE_SYMBOL mechanism 2015-03-05 00:59:38 +00:00
doc [build] Rename gPXE to iPXE 2010-04-19 23:43:39 +01:00
drivers [xhci] Support USB1 devices attached via transaction translators 2015-03-23 20:24:20 +00:00
hci [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-05 11:40:13 +00:00
image [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 16:35:29 +00:00
include [xhci] Support USB1 devices attached via transaction translators 2015-03-23 20:24:20 +00:00
interface [linux] Rewrite headers included in all builds 2015-03-05 02:43:37 +00:00
libgcc [build] Mark __intel_new_proc_init with __libgcc rather than cdecl 2009-08-03 15:56:10 +01:00
net [netdevice] Add missing bus types to netdev_fetch_bustype() 2015-03-18 16:42:39 +00:00
tests [libc] Add ffs(), ffsl(), and ffsll() 2015-03-16 15:40:53 +00:00
usr [autoboot] Match against parent devices when matching by bus type and location 2015-03-17 02:30:06 +00:00
util [build] Fix the REQUIRE_SYMBOL mechanism 2015-03-05 00:59:38 +00:00
.gitignore [build] Add support for local configuration files 2010-03-26 19:07:22 +00:00
doxygen.cfg [build] Remove PACKED macro 2010-05-29 23:49:47 +01:00
Makefile [usb] Add basic support for USB hubs 2015-02-03 12:19:52 +00:00
Makefile.housekeeping [build] Remove obsolete and unused portions of config.c 2015-03-04 14:49:43 +00:00