mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-02 19:52:03 +00:00
09405ba91c
Unsigned integer overflow is well-defined and not undefined behavior. But it is still useful to enable undefined behavior sanitizer checks on unsigned arithmetic to detect possible issues on counters or variables with similar purpose. Annotate functions, in which unsigned overflows are expected to happen, with the respective Clang function attribute[1]. GCC does not support sanitizing unsigned integer arithmetic[2]. avtab.c:76:2: runtime error: unsigned integer overflow: 6 * 3432918353 cannot be represented in type 'unsigned int' policydb.c:795:42: runtime error: unsigned integer overflow: 8160943042179512010 * 11 cannot be represented in type 'unsigned long' symtab.c:25:12: runtime error: left shift of 1766601759 by 4 places cannot be represented in type 'unsigned int' [1]: https://clang.llvm.org/docs/AttributeReference.html#no-sanitize [2]: https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html Signed-off-by: Christian Göttsche <cgzones@googlemail.com> |
||
---|---|---|
.. | ||
cil | ||
include | ||
man | ||
src | ||
tests | ||
utils | ||
.gitignore | ||
COPYING | ||
Makefile | ||
VERSION |