Linux Hardening
 help / color / mirror / Atom feed
* Unexpected Heap Randomization Behavior in Kernel Version 5.10.216
@ 2024-07-30 11:15 Prithivi Raj.S
  2024-07-30 16:17 ` Kees Cook
  0 siblings, 1 reply; 3+ messages in thread
From: Prithivi Raj.S @ 2024-07-30 11:15 UTC (permalink / raw)
  To: linux-hardening

I have been testing Address Space Layout Randomization (ASLR)
functionalities with the kernel.randomize_va_space sysctl parameter.
According to the kernel documentation:

0 disables randomization.
1 randomizes the address of mmap base, stack, and VDSO page.
2 randomizes the heap address.

However, I have observed that in kernel version 5.10.216, the heap
base address is being randomized even when kernel.randomize_va_space
is set to 1. This behavior is not the same as described for this
parameter.

I tested this on an older kernel version (3.10.0) from the CentOS 7.9
distribution, where the feature worked as documented.

Test Code:

int main() {
    // Get the current end of the heap
    void *heap_addr = sbrk(0);

    printf("Current end of heap (base address): %p\n", heap_addr);

    return 0;
}

I would like to know if this behavior indicates a kernel bug or if the
heap address randomization is being influenced by other factors. This
is my first communication with the Linux community, so please let me
know if there is anything inappropriate or missing in my report. I am
happy to provide any additional information if needed.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-06  6:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-30 11:15 Unexpected Heap Randomization Behavior in Kernel Version 5.10.216 Prithivi Raj.S
2024-07-30 16:17 ` Kees Cook
2024-08-06  6:12   ` Prithivi Raj.S

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox