Clang's new __builtin_dynamic_object_size can help detect more buffer overflows at runtime automatically. https://clang.llvm.org/docs/LanguageExtensions.html#evaluating-object-size-dynamically …
that currently makes adding mid-object poison kinda awkward, because if anyone decides to do ksize() on your allocation, suddenly the poison is gone
-
-
In user-space we have requested size, if we had that in kernel we could return it from ksize, but header memory is expensive. Also if you want some "fun" side-effects: https://bugzilla.kernel.org/show_bug.cgi?id=199359 …
-
Asking for rounded-up size and then allocating that size is obviously cleaner. Or have kmalloc_rounded which does both and returns actual size for perf reasons (if you return a struct with 2 words, that will be rax:rdx, so cheap and no stack accesses).
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.