mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-25 16:49:23 +00:00
efi: Generate stack protector canary at build time if urandom is available
Generating the canary at build time allows the canary to be different for every build which could limit the effectiveness of certain exploits. Fallback to the statically generated random bytes if /dev/urandom is not readable, e.g. Windows. On 32-bit architectures, which use a 32-bit canary, reduce the canary to 4 bytes with one byte being NUL to filter out string buffer overflow attacks. Signed-off-by: Glenn Washburn <development@efficientek.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
1 parent
e424e945c9
commit
dcc1af5d68
3 files changed
+23
-1
No files matched your search
@@ -64,6 +64,8 @@
|
||||
# define GRUB_TARGET_CPU "@GRUB_TARGET_CPU@"
|
||||
# define GRUB_PLATFORM "@GRUB_PLATFORM@"
|
||||
|
||||
# define GRUB_STACK_PROTECTOR_INIT @GRUB_STACK_PROTECTOR_INIT@
|
||||
|
||||
# define RE_ENABLE_I18N 1
|
||||
|
||||
# define _GNU_SOURCE 1
|
||||
|
||||
Reference in new issue
Block a user