21 minutes ago · Tech · hide

In my post about sanitizers as an oracle, I noted that ASan inside Docker on Ubuntu hangs or crashes “about one run in four”, and that the fix is vm.mmap_rnd_bits=28 on the host. I also said that Ubuntu “randomize[s] more of the address space than ASan’s shadow memory can live with”. That last part turns out to be wrong, and I wanted to look more into why this happened, and why only one in four times. Let’s take a one-byte oob vulnerable code: #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { char *p = malloc(8); printf("main=%p heap=%p\n", (void *)main, (void *)p); p[argc + 7] = 'x'; free(p); return 0; } … $ gcc -g -fsanitize=address overflow.c -o of-gcc && ./of-gcc 2>&1 | head -3 ================================================================= ==411033==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7b979bbe0018 at pc 0x55c12fec82b1 bp 0x7ffc08c5de00 sp 0x7ffc08c5ddf0 WRITE of size 1 at 0x7b979bbe0018 thread T0 On an Ubuntu 26.04 host with…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town