OrangePi_CM5/mm/kasan
Yee Lee 007213b1d0 BACKPORT: FROMLIST: kasan: add memzero int for unaligned size at DEBUG
Issue: when SLUB debug is on, hwtag kasan_unpoison() would overwrite the
redzone of object with unaligned size.

An additional memzero_explicit() path is added to replacing init by hwtag
instruction for those unaligned size at SLUB debug mode.

The penalty is acceptable since they are only enabled in debug mode, not
production builds.  A block of comment is added for explanation.

Link: https://lore.kernel.org/lkml/20210705103229.8505-3-yee.lee@mediatek.com/

Signed-off-by: Yee Lee <yee.lee@mediatek.com>
Suggested-by: Andrey Konovalov <andreyknvl@gmail.com>
Suggested-by: Marco Elver <elver@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Nicholas Tang <nicholas.tang@mediatek.com>
Cc: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Cc: Chinwen Chang <chinwen.chang@mediatek.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Bug: 193482732
Change-Id: Ie0f6a15637d212f5a273e13b7d271376c074cb91
Signed-off-by: Yee Lee <yee.lee@mediatek.com>
2021-07-15 16:49:20 +00:00
..
Makefile UPSTREAM: kasan, arm64: implement HW_TAGS runtime 2021-01-19 21:47:30 -08:00
common.c FROMGIT: kasan: use separate (un)poison implementation for integrated init 2021-06-17 14:39:37 -07:00
generic.c FROMGIT: kasan: init memory in kasan_(un)poison for HW_TAGS 2021-03-24 15:09:16 -07:00
hw_tags.c BACKPORT: FROMGIT: kasan: disable freed user page poisoning with HW tags 2021-06-17 14:39:37 -07:00
init.c UPSTREAM: arm/kasan: fix the array size of kasan_early_shadow_pte[] 2021-03-05 19:32:48 +00:00
kasan.h BACKPORT: FROMLIST: kasan: add memzero int for unaligned size at DEBUG 2021-07-15 16:49:20 +00:00
quarantine.c FROMGIT: kasan: prefix global functions with kasan_ 2021-02-07 13:41:41 -08:00
report.c FROMGIT: kasan: use dump_stack_lvl(KERN_ERR) to print stacks 2021-05-21 13:17:09 -07:00
report_generic.c FROMGIT: mm/kasan: switch from strlcpy to strscpy 2021-03-24 15:09:15 -07:00
report_hw_tags.c FROMGIT: kasan: prefix global functions with kasan_ 2021-02-07 13:41:41 -08:00
report_sw_tags.c FROMGIT: kasan: prefix global functions with kasan_ 2021-02-07 13:41:41 -08:00
shadow.c FROMGIT: kasan: init memory in kasan_(un)poison for HW_TAGS 2021-03-24 15:09:16 -07:00
sw_tags.c UPSTREAM: kasan: fix kasan_byte_accessible() to be consistent with actual checks 2021-05-14 19:52:50 +00:00