]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r338337: Fix lualoader on arm64
authorkevans <kevans@FreeBSD.org>
Thu, 21 Feb 2019 02:46:32 +0000 (02:46 +0000)
committerkevans <kevans@FreeBSD.org>
Thu, 21 Feb 2019 02:46:32 +0000 (02:46 +0000)
commitc9243af12d3c57e3cdb796303947fd33c997cfc9
tree30ad4143ce9e875fa297455b7e47b8870dc985f3
parentca72dbec9716196623defb6dc3d296a7e6dbc84b
MFC r338337: Fix lualoader on arm64

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.
stand/efi/boot1/Makefile
stand/efi/loader/arch/arm64/start.S