Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 180D9CDB487 for ; Wed, 18 Oct 2023 19:13:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231492AbjJRTNY (ORCPT ); Wed, 18 Oct 2023 15:13:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231390AbjJRTNV (ORCPT ); Wed, 18 Oct 2023 15:13:21 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDDCE126 for ; Wed, 18 Oct 2023 12:13:18 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B1D4C433C8; Wed, 18 Oct 2023 19:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1697656398; bh=zQ16N2EYf07CLWGmzzUPXhI2x2RI+ScDmfwEJrcF6TE=; h=Date:To:From:Subject:From; b=WJmbjMI/21BzV2EAXQGoCHdxjV2+cwLaMtXnuxFBFX4QrSzZ3xaJiqL090yeiApNQ b7wQTN8vmjPK12qOEOs3DoUVT1/3vrgX52IZslqw+Edk0Xcq/+nlh5iAInQp1GlQMO 9eS88sak9lr/gMPMbgBP0VG4b8liX4LmipAwAOSM= Date: Wed, 18 Oct 2023 12:13:17 -0700 To: mm-commits@vger.kernel.org, vincenzo.frascino@arm.com, ryabinin.a.a@gmail.com, matthias.bgg@gmail.com, keescook@chromium.org, haibo.li@mediatek.com, glider@google.com, dvyukov@google.com, angelogioacchino.delregno@collabora.com, andreyknvl@gmail.com, arnd@arndb.de, akpm@linux-foundation.org From: Andrew Morton Subject: [merged mm-hotfixes-stable] kasan-print-the-original-fault-addr-when-access-invalid-shadow-fix.patch removed from -mm tree Message-Id: <20231018191318.6B1D4C433C8@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The quilt patch titled Subject: kasan: disable kasan_non_canonical_hook() for HW tags has been removed from the -mm tree. Its filename was kasan-print-the-original-fault-addr-when-access-invalid-shadow-fix.patch This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: Arnd Bergmann Subject: kasan: disable kasan_non_canonical_hook() for HW tags Date: Mon, 16 Oct 2023 22:08:38 +0200 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 Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Haibo Li Cc: Kees Cook Cc: Vincenzo Frascino Cc: AngeloGioacchino Del Regno Cc: Matthias Brugger Signed-off-by: Andrew Morton --- include/linux/kasan.h | 6 +++--- mm/kasan/report.c | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) --- a/include/linux/kasan.h~kasan-print-the-original-fault-addr-when-access-invalid-shadow-fix +++ a/include/linux/kasan.h @@ -466,10 +466,10 @@ static inline void kasan_free_module_sha #endif /* (CONFIG_KASAN_GENERIC || CONFIG_KASAN_SW_TAGS) && !CONFIG_KASAN_VMALLOC */ -#ifdef CONFIG_KASAN +#if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS) void kasan_non_canonical_hook(unsigned long addr); -#else /* CONFIG_KASAN */ +#else /* CONFIG_KASAN_GENERIC || CONFIG_KASAN_SW_TAGS */ static inline void kasan_non_canonical_hook(unsigned long addr) { } -#endif /* CONFIG_KASAN */ +#endif /* CONFIG_KASAN_GENERIC || CONFIG_KASAN_SW_TAGS */ #endif /* LINUX_KASAN_H */ --- a/mm/kasan/report.c~kasan-print-the-original-fault-addr-when-access-invalid-shadow-fix +++ a/mm/kasan/report.c @@ -621,8 +621,9 @@ void kasan_report_async(void) } #endif /* CONFIG_KASAN_HW_TAGS */ +#if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS) /* - * With CONFIG_KASAN, accesses to bogus pointers (outside the high + * With CONFIG_KASAN_INLINE, accesses to bogus pointers (outside the high * canonical half of the address space) cause out-of-bounds shadow memory reads * before the actual access. For addresses in the low canonical half of the * address space, as well as most non-canonical addresses, that out-of-bounds @@ -658,3 +659,4 @@ void kasan_non_canonical_hook(unsigned l pr_alert("KASAN: %s in range [0x%016lx-0x%016lx]\n", bug_type, orig_addr, orig_addr + KASAN_GRANULE_SIZE - 1); } +#endif _ Patches currently in -mm which might be from arnd@arndb.de are fs-proc-task_mmu-implement-ioctl-to-get-and-optionally-clear-info-about-ptes-fix-3.patch