KSPP / linux

Linux kernel source tree (Kernel Self Protection Project)
https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project
Other
80 stars 5 forks source link

Detect pointer math wrap-around (overflow and underflow) #344

Open kees opened 9 months ago

kees commented 9 months ago

Much like issue #26 and issue #27, we must mitigate pointer arithmetic wrap-around (overflow/underflow). This should be possible via -fsanitize=pointer-overflow but it has similar problems as the other issues, namely -fwrapv-pointer.

JustinStitt commented 9 months ago

As for bullet point 2: fix sanitizer to work at all on Clang: https://github.com/llvm/llvm-project/issues/66451 it looks like this sanitizer DOES work... just not for void* 😕

demo: https://godbolt.org/z/Ef3Kvqq1x

~What's going on here?~

Update: I triaged and nikic fixed here: https://github.com/llvm/llvm-project/pull/67772