diff options
author | Andrew Turner <andrew@FreeBSD.org> | 2018-08-27 11:14:49 +0000 |
---|---|---|
committer | Andrew Turner <andrew@FreeBSD.org> | 2018-08-27 11:14:49 +0000 |
commit | 78da60464191371524fd3d85da0a9efe63369497 (patch) | |
tree | 092d295c18b5d98a95294d4103909062803b580b /stand/efi/boot1/Makefile | |
parent | 9ea0458663f0e58baf933e9919eed9a2de571828 (diff) | |
download | src-78da60464191371524fd3d85da0a9efe63369497.tar.gz src-78da60464191371524fd3d85da0a9efe63369497.zip |
Ensure we have a large enough stack for the lua loader
Lua has a few places where it allocates a large buffer on the stack. This
is normally fine, except there are a few places where there can be multiple
frames with this buffer. This can cause a stack overflow on some arm64 SoCs.
Fix this by allocating our own stack in loader.efi large enough for these
objects. The required size has been found by tracing how the stack pointer
changes in a virtual machine and found to be no larger than 50kB. A
larger stack is allocated to reduce the likelihood of overflow from future
changes.
Reviewed by: kevans
Approved by: re (kib)
Differential Revision: https://reviews.freebsd.org/D16886
Notes
Notes:
svn path=/head/; revision=338337
Diffstat (limited to 'stand/efi/boot1/Makefile')
-rw-r--r-- | stand/efi/boot1/Makefile | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/stand/efi/boot1/Makefile b/stand/efi/boot1/Makefile index 57610292bd83..88bbb312970c 100644 --- a/stand/efi/boot1/Makefile +++ b/stand/efi/boot1/Makefile @@ -6,6 +6,7 @@ PROG= boot1.sym INTERNALPROG= WARNS?= 6 +CFLAGS+= -DEFI_BOOT1 # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only # seems to matter on arm64 where wchar_t defaults to an int instead |