On Tue, Dec 19, 2023 at 02:18:07PM +0530, Amit Pundir wrote:
From: Arnd Bergmann arnd@arndb.de
[ Upstream commit 17c17567fe510857b18fe01b7a88027600e76ac6 ]
On arm64, building with CONFIG_KASAN_HW_TAGS now causes a compile-time error:
mm/kasan/report.c: In function 'kasan_non_canonical_hook': mm/kasan/report.c:637:20: error: 'KASAN_SHADOW_OFFSET' undeclared (first use in this function) 637 | if (addr < KASAN_SHADOW_OFFSET) | ^~~~~~~~~~~~~~~~~~~ mm/kasan/report.c:637:20: note: each undeclared identifier is reported only once for each function it appears in mm/kasan/report.c:640:77: error: expected expression before ';' token 640 | orig_addr = (addr - KASAN_SHADOW_OFFSET) << KASAN_SHADOW_SCALE_SHIFT;
This was caused by removing the dependency on CONFIG_KASAN_INLINE that used to prevent this from happening. Use the more specific dependency on KASAN_SW_TAGS || KASAN_GENERIC to only ignore the function for hwasan mode.
Link: https://lkml.kernel.org/r/20231016200925.984439-1-arnd@kernel.org Fixes: 12ec6a919b0f ("kasan: print the original fault addr when access invalid shadow") Signed-off-by: Arnd Bergmann arnd@arndb.de Cc: Alexander Potapenko glider@google.com Cc: Andrey Konovalov andreyknvl@gmail.com Cc: Andrey Ryabinin ryabinin.a.a@gmail.com Cc: Dmitry Vyukov dvyukov@google.com Cc: Haibo Li haibo.li@mediatek.com Cc: Kees Cook keescook@chromium.org Cc: Vincenzo Frascino vincenzo.frascino@arm.com Cc: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Cc: Matthias Brugger matthias.bgg@gmail.com Signed-off-by: Andrew Morton akpm@linux-foundation.org Signed-off-by: Amit Pundir amit.pundir@linaro.org
Needed on v6.1.y as well.
Now queued up, thanks.
greg k-h