Merge pull request #28527 from medhefgo/boot-stack-guard
boot: Fall back to using image load address for stack guard
This commit is contained in:
@@ -79,6 +79,9 @@ void __stack_chk_guard_init(void) {
|
||||
EFI_RNG_PROTOCOL *rng;
|
||||
if (BS->LocateProtocol(MAKE_GUID_PTR(EFI_RNG_PROTOCOL), NULL, (void **) &rng) == EFI_SUCCESS)
|
||||
(void) rng->GetRNG(rng, NULL, sizeof(__stack_chk_guard), (void *) &__stack_chk_guard);
|
||||
else
|
||||
/* Better than no extra entropy. */
|
||||
__stack_chk_guard ^= (intptr_t) &__ImageBase;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user