[PATCH] D35735: [ubsan] Null-check pointers in -fsanitize=vptr (PR33881)
Vedant Kumar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 21 13:34:01 PDT 2017
vsk created this revision.
The instrumentation generated by -fsanitize=vptr does not null check a
user pointer before loading from it. This causes crashes in the face of
UB member calls (this=nullptr), i.e it causes user programs to crash only
after UBSan is turned on.
The fix is to make run-time null checking a prerequisite for enabling
-fsanitize=vptr, and to then teach UBSan to reuse these run-time null
checks to make -fsanitize=vptr safe.
Testing: check-clang, check-ubsan, a stage2 ubsan-enabled build
(Test updates in compiler-rt to follow in a separate patch)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 16906 bytes
Desc: not available
More information about the cfe-commits