data before initialization, which may contain uncleared sensitive data • Out-of-bound read: Reading across object boundaries • Use-after-free: Using freed pointer/size that can be attacker controlled • Others: Missing permission check, race condition
if there is no assignment or memset between the allocation and copy_to_user • STACKLEAK: clears the used kernel stack when the control is transferred back to the user space • Detecting uninitialized memory accesses • -Wuninitialized: intra-procedural analysis • dynamic tracking: >10x overhead • MemorySanitizer: 3-4x overhead • Protections using zero-initialization
kernel space, it will always be stored to a non-kernel-stack location (or non- AllocaInst to be specific) • Rule 1: A StoreInst is a sink if the destination is not allocated by an AllocaInst in kernel • Rule 2: A CallInst is a sink if the called value is inline assembly that is not in the whitelist • Rule 3: A CallInst is a sink if the called function’s body is empty
value during initialization analysis • check whether initialized by memset using the same size • if yes, instrument to compute the size then pass to memset to initialize