summaryrefslogtreecommitdiffstats
path: root/lib/win_minmax.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2019-04-24 09:19:25 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-31 06:48:17 -0700
commit50013eadda59b9bbbc48eee40ecbfccefc875cc6 (patch)
tree97b417880c8fc0e2853dc53c910d170107c44b54 /lib/win_minmax.c
parentf08f10f79267eb5d79aab724dcf6d8f60dcc2f6d (diff)
downloadlinux-stable-50013eadda59b9bbbc48eee40ecbfccefc875cc6.tar.gz
linux-stable-50013eadda59b9bbbc48eee40ecbfccefc875cc6.tar.bz2
linux-stable-50013eadda59b9bbbc48eee40ecbfccefc875cc6.zip
mm/uaccess: Use 'unsigned long' to placate UBSAN warnings on older GCC versions
[ Upstream commit 29da93fea3ea39ab9b12270cc6be1b70ef201c9e ] Randy reported objtool triggered on his (GCC-7.4) build: lib/strncpy_from_user.o: warning: objtool: strncpy_from_user()+0x315: call to __ubsan_handle_add_overflow() with UACCESS enabled lib/strnlen_user.o: warning: objtool: strnlen_user()+0x337: call to __ubsan_handle_sub_overflow() with UACCESS enabled This is due to UBSAN generating signed-overflow-UB warnings where it should not. Prior to GCC-8 UBSAN ignored -fwrapv (which the kernel uses through -fno-strict-overflow). Make the functions use 'unsigned long' throughout. Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: luto@kernel.org Link: http://lkml.kernel.org/r/20190424072208.754094071@infradead.org Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib/win_minmax.c')
0 files changed, 0 insertions, 0 deletions