]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC 279949:
authorjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 9 Apr 2015 19:36:06 +0000 (19:36 +0000)
committerjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 9 Apr 2015 19:36:06 +0000 (19:36 +0000)
commitf2303575612d0e7da2199cfe18adfbf1ae999088
tree8c06a1ac00f83852efeab556cd073920fd1a6687
parent089f951f1f9df4bff8d941022b2e9f60927f8dce
MFC 279949:
The System V ABI for amd64 allows functions to use space in a 128 byte
redzone below the stack pointer for scratch space and requires
interrupt and signal frames to avoid overwriting it. However, EFI uses
the Windows ABI which does not support this. As a result, interrupt
handlers in EFI push their interrupt frames directly on top of the
stack pointer. If the compiler used the red zone in a function in the
EFI loader, then a device interrupt that occurred while that function
was running could trash its local variables.  In practice this happens
fairly reliable when using gzipfs as an interrupt during decompression
can trash the local variables in the inflate_table() function
resulting in corrupted output or hangs.

Fix this by disabling the redzone for amd64 EFI binaries. This
requires building not only the loader but any libraries used by the
loader without redzone support.

Thanks to Jilles for pointing me at the redzone once I found the stack
corruption.

git-svn-id: svn://svn.freebsd.org/base/stable/10@281321 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libstand/Makefile
sys/boot/amd64/Makefile.inc
sys/boot/efi/libefi/Makefile
sys/boot/ficl/Makefile