aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/modules.py
diff options
context:
space:
mode:
authorArd Biesheuvel <[email protected]>2016-01-11 10:43:16 +0100
committerCatalin Marinas <[email protected]>2016-02-24 14:57:28 +0000
commit2ddbfc81eac84a299cb4747a8764bc43f23e9008 (patch)
tree958da4ff15f5fc23a4d65a427a41537a6a747cfb /scripts/gdb/linux/modules.py
parente4fbf4767440472f9d23b0f25a2b905e1c63b6a8 (diff)
efi: stub: add implementation of efi_random_alloc()
This implements efi_random_alloc(), which allocates a chunk of memory of a certain size at a certain alignment, and uses the random_seed argument it receives to randomize the address of the allocation. This is implemented by iterating over the UEFI memory map, counting the number of suitable slots (aligned offsets) within each region, and picking a random number between 0 and 'number of slots - 1' to select the slot, This should guarantee that each possible offset is chosen equally likely. Suggested-by: Kees Cook <[email protected]> Reviewed-by: Matt Fleming <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/modules.py')
0 files changed, 0 insertions, 0 deletions