compiler.h: Add read_word_at_a_time() function.
authorAndrey Ryabinin <aryabinin@virtuozzo.com>
Thu, 1 Feb 2018 18:00:49 +0000 (21:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Aug 2019 07:33:32 +0000 (09:33 +0200)
commit4b5d4bdfd1ea2c2946f55ba309e17440b4ddada2
tree7998f07cb9a3fcdaf29ead06f752448a08e07d8a
parent229b670e66689326c97639b4767c12c33462dac1
compiler.h: Add read_word_at_a_time() function.

[ Upstream commit 7f1e541fc8d57a143dd5df1d0a1276046e08c083 ]

Sometimes we know that it's safe to do potentially out-of-bounds access
because we know it won't cross a page boundary.  Still, KASAN will
report this as a bug.

Add read_word_at_a_time() function which is supposed to be used in such
cases.  In read_word_at_a_time() KASAN performs relaxed check - only the
first byte of access is validated.

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/compiler.h