opnsense-src/lib/libstand
John Baldwin ad06e987b1 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.

Differential Revision:	https://reviews.freebsd.org/D2054
Reviewed by:	imp
MFC after:	2 weeks
Sponsored by:	Cisco Systems, Inc.
2015-03-13 09:38:16 +00:00
..
amd64 Move the 64-bit _setjmp to lib/libstand. 2012-12-21 15:15:35 +00:00
i386 Use, in uncovered part, the END() macro in order to improve debugging. 2009-05-25 14:37:10 +00:00
mips Merge @228176 from Perforce to fix a bug introduced in r249553: 2013-04-28 14:40:29 +00:00
powerpc Fix loader on PowerPC following r279784. It turns out that, due to .PATH 2015-03-09 02:19:44 +00:00
sparc64 Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
__main.c Switch to ANSI function prototypes in a few places. 2011-05-03 04:44:50 +00:00
arp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
assert.c Use panic() (which the environment is required to provide to libstand) to 2010-03-30 19:07:41 +00:00
bcd.c
bootp.c Replace index() and rindex() calls with strchr() and strrchr(). 2012-01-03 18:51:58 +00:00
bootp.h
bootparam.c
bootparam.h
bswap.c Consitently use "__LP64__". 2012-05-24 21:44:46 +00:00
bzipfs.c Remove two pieces of code (one disabled in revision 39665 and another derived 2010-03-18 00:27:17 +00:00
cd9660.c Fix loader's ability to read the 10.1 release PowerPC ISOs. There appears to 2014-12-30 16:55:53 +00:00
close.c Clear f_rabuf after freeing the memory it points to. This prevents a 2013-12-18 04:52:30 +00:00
closeall.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
dev.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
dosfs.c Spin the twiddle in dosfs to give visual feedback for disk I/O on 2015-03-12 17:10:04 +00:00
dosfs.h Fix readdir for the root directory on a FAT32 file system. The root 2013-12-19 05:23:10 +00:00
environment.c Fix an inappropriate free of a non-dynamic value. While here, make the 2013-12-18 17:03:43 +00:00
ether.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
ext2fs.c Add a divisor parameter to twiddle() so that callers can request that output 2014-12-22 20:42:36 +00:00
fstat.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
getopt.c Switch to ANSI function prototypes in a few places. 2011-05-03 04:44:50 +00:00
gets.c Fix an off-by-one buffer overflow in ngets(). 2009-03-31 14:30:46 +00:00
globals.c
gzipfs.c Remove two pieces of code (one disabled in revision 39665 and another derived 2010-03-18 00:27:17 +00:00
in_cksum.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
inet_ntoa.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
ioctl.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
iodesc.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
libstand.3 Fix usage example in kvprintf(9) and its copy in libstand(3): trailing '\n' 2015-01-23 07:30:57 +00:00
lseek.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
Makefile The System V ABI for amd64 allows functions to use space in a 128 byte 2015-03-13 09:38:16 +00:00
nandfs.c Add a divisor parameter to twiddle() so that callers can request that output 2014-12-22 20:42:36 +00:00
net.c In sendrecv function, change the receive timeout value between retries 2011-06-15 21:58:01 +00:00
net.h Increase maximum network timeout from 20s to 120s. Given that an ETIMEDOUT 2010-09-28 01:30:49 +00:00
netif.c Remove 'register' keyword. 2002-03-21 23:39:28 +00:00
netif.h
nfs.c Add a divisor parameter to twiddle() so that callers can request that output 2014-12-22 20:42:36 +00:00
nfsv2.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
nullfs.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
open.c Provide a means for loaders to control which file system to use. This 2014-07-30 16:08:16 +00:00
pager.c
pkgfs.c Add pkgfs, a file system implementation for reading files out of a 2014-07-31 23:25:13 +00:00
printf.c Fix usage example in kvprintf(9) and its copy in libstand(3): trailing '\n' 2015-01-23 07:30:57 +00:00
qdivrem.c libstand's qdivrem.c assumes that sizeof(int) == sizeof(long), this is not 2014-07-24 19:06:15 +00:00
quad.h libstand's qdivrem.c assumes that sizeof(int) == sizeof(long), this is not 2014-07-24 19:06:15 +00:00
random.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
rarp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
read.c Add a divisor parameter to twiddle() so that callers can request that output 2014-12-22 20:42:36 +00:00
readdir.c
rpc.c ANSIfy, whitespace and comment adjustments, to simplify comparing these 2009-09-13 21:51:01 +00:00
rpc.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
rpcv2.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
saioctl.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
sbrk.c Set the malloc alignment to 64 bytes on platforms that use the U-Boot API 2014-02-05 22:53:58 +00:00
splitfs.c Remove unused variable. Shorten the path to WARNS=6 compliance. 2005-05-20 12:55:38 +00:00
stand.h Add a divisor parameter to twiddle() so that callers can request that output 2014-12-22 20:42:36 +00:00
stat.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strcasecmp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strdup.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strerror.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strtol.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strtoul.c Fix includes for use in libstand. 2013-02-19 17:09:23 +00:00
tftp.c Add a divisor parameter to twiddle() so that callers can request that output 2014-12-22 20:42:36 +00:00
tftp.h
twiddle.c Add a divisor parameter to twiddle() so that callers can request that output 2014-12-22 20:42:36 +00:00
udp.c Add #include <netinet/in_pcb.h> for missing forward declation of 2011-05-03 07:39:54 +00:00
ufs.c Add a divisor parameter to twiddle() so that callers can request that output 2014-12-22 20:42:36 +00:00
write.c Add a divisor parameter to twiddle() so that callers can request that output 2014-12-22 20:42:36 +00:00
zalloc.c Set the malloc alignment to 64 bytes on platforms that use the U-Boot API 2014-02-05 22:53:58 +00:00
zalloc_defs.h Set the malloc alignment to 64 bytes on platforms that use the U-Boot API 2014-02-05 22:53:58 +00:00
zalloc_malloc.c - Removing some unneeded definitions of NULL(cruft related to 1970's C). 2011-07-10 07:25:34 +00:00
zalloc_mem.h Set the malloc alignment to 64 bytes on platforms that use the U-Boot API 2014-02-05 22:53:58 +00:00
zalloc_protos.h - Removing some unneeded definitions of NULL(cruft related to 1970's C). 2011-07-10 07:25:34 +00:00