linux/mm/kasan
Andrey Konovalov cde8a7eb77 kasan: ensure poisoning size alignment
A previous changes d99f6a10c1 ("kasan: don't round_up too much")
attempted to simplify the code by adding a round_up(size) call into
kasan_poison().  While this allows to have less round_up() calls around
the code, this results in round_up() being called multiple times.

This patch removes round_up() of size from kasan_poison() and ensures that
all callers round_up() the size explicitly.  This patch also adds
WARN_ON() alignment checks for address and size to kasan_poison() and
kasan_unpoison().

Link: https://lkml.kernel.org/r/3ffe8d4a246ae67a8b5e91f65bf98cd7cba9d7b9.1612546384.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Branislav Rankov <Branislav.Rankov@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-02-26 09:41:03 -08:00
..
common.c kasan: ensure poisoning size alignment 2021-02-26 09:41:03 -08:00
generic.c kfence, kasan: make KFENCE compatible with KASAN 2021-02-26 09:41:02 -08:00
hw_tags.c kasan, arm64: allow using KUnit tests with HW_TAGS mode 2021-02-24 13:38:31 -08:00
init.c kasan: fix incorrect arguments passing in kasan_add_zero_shadow 2021-01-24 10:34:52 -08:00
kasan.h kasan: ensure poisoning size alignment 2021-02-26 09:41:03 -08:00
Makefile kasan, arm64: implement HW_TAGS runtime 2020-12-22 12:55:08 -08:00
quarantine.c kasan: prefix global functions with kasan_ 2021-02-24 13:38:30 -08:00
report.c kasan: use error_report_end tracepoint 2021-02-26 09:41:02 -08:00
report_generic.c kasan: prefix global functions with kasan_ 2021-02-24 13:38:30 -08:00
report_hw_tags.c kasan: prefix global functions with kasan_ 2021-02-24 13:38:30 -08:00
report_sw_tags.c kasan: prefix global functions with kasan_ 2021-02-24 13:38:30 -08:00
shadow.c kasan: ensure poisoning size alignment 2021-02-26 09:41:03 -08:00
sw_tags.c kasan: fix bug detection via ksize for HW_TAGS mode 2021-02-24 13:38:31 -08:00