summaryrefslogtreecommitdiffstats
path: root/kernel/audit_watch.c
diff options
context:
space:
mode:
authorEric Biggers2016-08-19 21:15:22 +0200
committerKees Cook2016-08-23 04:07:55 +0200
commit7329a655875a2f4bd6984fe8a7e00a6981e802f3 (patch)
tree5c77614be62600da9d02d3b57709280e91e7292d /kernel/audit_watch.c
parentMerge tag 'arc-4.8-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff)
downloadkernel-qcow2-linux-7329a655875a2f4bd6984fe8a7e00a6981e802f3.tar.gz
kernel-qcow2-linux-7329a655875a2f4bd6984fe8a7e00a6981e802f3.tar.xz
kernel-qcow2-linux-7329a655875a2f4bd6984fe8a7e00a6981e802f3.zip
usercopy: avoid potentially undefined behavior in pointer math
check_bogus_address() checked for pointer overflow using this expression, where 'ptr' has type 'const void *': ptr + n < ptr Since pointer wraparound is undefined behavior, gcc at -O2 by default treats it like the following, which would not behave as intended: (long)n < 0 Fortunately, this doesn't currently happen for kernel code because kernel code is compiled with -fno-strict-overflow. But the expression should be fixed anyway to use well-defined integer arithmetic, since it could be treated differently by different compilers in the future or could be reported by tools checking for undefined behavior. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'kernel/audit_watch.c')
0 files changed, 0 insertions, 0 deletions