Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D665C433E7 for ; Tue, 13 Oct 2020 03:24:39 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8CACE20790 for ; Tue, 13 Oct 2020 03:24:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kDljMzGP"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="d/4cJeto" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CACE20790 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:Subject: From:References:To:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Hzpk0CzlJ3XUMdMI84sJAXUHw5gYjyRhk5p1htOSBm8=; b=kDljMzGPVhrMys6Jpzga+Tu2H tPlZ/qeHe69oN0eCtHPB0AEjG0IB+BUwtvxWl5ArImRu4kXcNiapfgqFwKwN7rVFnTDq247JE+zkz Q8beeY9XktJxGjio46wzjRy+rzOcoeYz+bPgN1oc0sK21j1d9Bs+OqFONGzu1K8qBKW+klOWQHHZk bDRL2tu1keWXr72cIQciBIJCVWCOCK1KXRxAwdAtvreudTVCEJUlMXxRjq5F/cxjN/jTDAP58oq/g /LojeibcsU3UVP4sVnOpeKGOlrwXuFhWiOrVPmiJZFezAv1CkEnytnfQ758XEo2ZlTJwOL1Gkb1P5 15Qrr7wIg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSAtb-0003nQ-23; Tue, 13 Oct 2020 03:22:39 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSAtY-0003mw-55 for linux-arm-kernel@lists.infradead.org; Tue, 13 Oct 2020 03:22:37 +0000 Received: by mail-pf1-x444.google.com with SMTP id b26so15786423pff.3 for ; Mon, 12 Oct 2020 20:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:references:from:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Q9Qpn11LlPaJ2b2MQJxlqYoHqBZOk3pal1ats4769NE=; b=d/4cJetourV075pOl1+W0K9wABU2PeluS8X+w5dX6xd6mHs38Pv2oPpdkwmMtvjlCv s7LNAUEUzXnPFntHQf2Rc06OciFFSUQT9E5kKvvLUrs9hOjatPmW05dOoz/fGwp7sVTi VQS/bXawiIna0dbw8LbAKkQwFiigz/WQ/OyiVwqs8wkzqTnvabTLO+l878sAbxJad60V MuQQqgjRHdIGJ+AlDu66k4DmaivgMJGrv/+KRpNje7LeNfIla3bht1LAnmx8mgFiNKfU SjI/Dg8mdh9ivYcix0RywHqKvXtkhSW1lD0uJNphkjC1qBc4yCVLQ6riYrfm6dBQiFJU w2mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Q9Qpn11LlPaJ2b2MQJxlqYoHqBZOk3pal1ats4769NE=; b=HV+FC5Na8bYQ0L2w98fS3npa6U+ncnBc6X+BQCNh3zHLm2B+hTm/H0kMNfdfP2i4bQ JlNzS4hovoi+p2/cX6KA3OeA3HdXX6EMfZsaMInBheIgRDuMvQMaJtCtI8I4m68Ubaww +Zeyj2siLo2rlfiXVOEfEdh1WXQXGY+/n0mPHem1LVK2mtgmxymsiuVVlBrpWD6/6tjv nS5DacYYGhgMuVzZtGR0iacBF7pSZBeBELuHoBJSwQI9kqvl17nOvyv4/i9BU2w4jAsv EZqBIHeZH7yC7hSHjh06yNxKtQuP9fc2UfVDXiPBT/6YMMfcCio4B1yrbjgWXaOT15om CCZA== X-Gm-Message-State: AOAM532nv3RdieX3MHXAoAYPIYwwij4+tEYXKvIdwgczyOzhfkXo668L M8WHlIgbF7LseJi9Aiw7USc= X-Google-Smtp-Source: ABdhPJzzGnvjq7a37fyCfRqy36kL577rMRw40/HoFtyPAeBwLyOb4L7+eud1XZxyHrjn+Wxk5klOyg== X-Received: by 2002:a63:1d12:: with SMTP id d18mr12459725pgd.314.1602559351098; Mon, 12 Oct 2020 20:22:31 -0700 (PDT) Received: from [10.230.29.112] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id e16sm21788013pjr.36.2020.10.12.20.22.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Oct 2020 20:22:30 -0700 (PDT) To: Linus Walleij , Abbott Liu , Russell King , Ard Biesheuvel , Andrey Ryabinin , Mike Rapoport References: <20201012215701.123389-1-linus.walleij@linaro.org> From: Florian Fainelli Subject: Re: [PATCH 0/5 v15] KASan for Arm Message-ID: <2c91be6f-fba6-6623-1063-99d8a1ae48de@gmail.com> Date: Mon, 12 Oct 2020 20:22:28 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: <20201012215701.123389-1-linus.walleij@linaro.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201012_232236_299045_A4C162D8 X-CRM114-Status: GOOD ( 28.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 10/12/2020 2:56 PM, Linus Walleij wrote: > This is the 15th iteration of KASan for ARM/Aarch32. > > I dropped my fix in the beginning of the series for > Ard's more elaborate and thorough fix moving the DTB > out of the kernel linear mapped region and into its own > part of the memory. > > This fixes my particular issue on the Qualcomm APQ8060 > and I hope it may also solve Florian's issue and what > Ard has been seeing. KASan should be working with > pretty much everything you throw on it, unless you > do what I did and ran it on a 64MB system, where > under some load it can run into the OOM killer for > obvious reasons. > > You are encouraged to test this patch set to find memory out > of bounds bugs with ARM32 platforms and drivers. > > There is a git branch you can pull in: > https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git/log/?h=kasan > > This branch includes Ard's two patches. > > As Ard's patches are in Russell's patch tracker I will > put these there as well if it now works for everyone. Tested-by: Florian Fainelli On Brahma-B15 (ARMv7 LPAE) and Brahma-B53 (ARMv8 in AArch32, also with LPAE). The 3 Cortex-A72 devices that I have access to all fail with the following (not related to the CPU type, more to the memory map) which I am hoping to track down later this week, I would not consider those failures to be a blocker at this point. Thanks a lot for your persistence working on this Linus, and Ard! [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 5.9.0-gdf4dd84a3f7d (fainelli@fainelli-desktop) (arm-linux-gcc (GCC) 8.3.0, GNU ld (GNU Binutils) 2.32) #16 SMP Mon Oct 12 20:01:43 PDT 2020 [ 0.000000] CPU: ARMv7 Processor [410fd083] revision 3 (ARMv7), cr=30c5383d [ 0.000000] CPU: div instructions available: patching division code [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache [ 0.000000] OF: fdt: Machine model: BCM972112SV [ 0.000000] earlycon: pl11 at MMIO 0x000000047e201000 (options '115200') [ 0.000000] printk: bootconsole [pl11] enabled [ 0.000000] Memory policy: Data cache writealloc [ 0.000000] cma: Reserved 16 MiB at 0x000000007f000000 [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000000000000-0x000000002fffffff] [ 0.000000] Normal empty [ 0.000000] HighMem [mem 0x0000000030000000-0x000000007fffffff] [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000000000-0x00000000063fdfff] [ 0.000000] node 0: [mem 0x0000000006400000-0x000000000fffffff] [ 0.000000] node 0: [mem 0x0000000010400000-0x000000007fffffff] [ 0.000000] Zeroed struct page in unavailable ranges: 2 pages [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000007fffffff] [ 0.000000] kasan: Mapping kernel virtual memory block: c0000000-c63fe000 at shadow: b7000000-b7c7fc00 [ 0.000000] Kernel panic - not syncing: kasan_pte_populate failed to alloc pte for address 0xe2806000 [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.9.0-gdf4dd84a3f7d #16 [ 0.000000] Hardware name: Broadcom STB (Flattened Device Tree) [ 0.000000] Backtrace: [ 0.000000] [] (dump_backtrace) from [] (show_stack+0x20/0x24) [ 0.000000] r9:ffffffff r8:00000080 r7:c298e3c0 r6:600000d3 r5:00000000 r4:c298e3c0 [ 0.000000] [] (show_stack) from [] (dump_stack+0xbc/0xe0) [ 0.000000] [] (dump_stack) from [] (panic+0x19c/0x3e4) [ 0.000000] r10:e2806000 r9:c2b790e0 r8:c166b410 r7:c2803d80 r6:00000000 r5:c2b7de80 [ 0.000000] r4:c2b78e20 r3:00000001 [ 0.000000] [] (panic) from [] (kasan_pgd_populate+0x1ac/0x26c) [ 0.000000] r3:00000000 r2:e2806000 r1:c12126d4 r0:c166b410 [ 0.000000] r7:b7c7fc00 [ 0.000000] [] (kasan_pgd_populate) from [] (create_mapping+0x58/0x64) [ 0.000000] r10:c166b4e4 r9:00000000 r8:063fe000 r7:c2ba0a40 r6:c28a24e0 r5:b7000000 [ 0.000000] r4:b7c7fc00 [ 0.000000] [] (create_mapping) from [] (kasan_init+0x26c/0x390) [ 0.000000] r5:00000000 r4:c0000000 [ 0.000000] [] (kasan_init) from [] (setup_arch+0x288/0xa28) [ 0.000000] r10:c1861238 r9:410fd083 r8:c0008000 r7:c1873a40 r6:c2803fbc r5:c2fdcf60 [ 0.000000] r4:c28a2280 [ 0.000000] [] (setup_arch) from [] (start_kernel+0x88/0x3e4) [ 0.000000] r10:c2806d40 r9:410fd083 r8:0e415000 r7:ffffffff r6:30c0387d r5:c2806d48 [ 0.000000] r4:00007000 [ 0.000000] [] (start_kernel) from [<00000000>] (0x0) [ 0.000000] r10:30c5387d r9:410fd083 r8:0e415000 r7:ffffffff r6:30c0387d r5:00000000 [ 0.000000] r4:c1800334 [ 0.000000] ---[ end Kernel panic - not syncing: kasan_pte_populate failed to alloc pte for address 0xe2806000 ]--- > > Abbott Liu (1): > ARM: Define the virtual space of KASan's shadow region > > Andrey Ryabinin (3): > ARM: Disable KASan instrumentation for some code > ARM: Replace string mem* functions for KASan > ARM: Enable KASan for ARM > > Linus Walleij (1): > ARM: Initialize the mapping of KASan shadow memory > > Documentation/arm/memory.rst | 5 + > Documentation/dev-tools/kasan.rst | 4 +- > .../features/debug/KASAN/arch-support.txt | 2 +- > arch/arm/Kconfig | 10 + > arch/arm/boot/compressed/Makefile | 1 + > arch/arm/boot/compressed/string.c | 19 ++ > arch/arm/include/asm/kasan.h | 33 ++ > arch/arm/include/asm/kasan_def.h | 81 +++++ > arch/arm/include/asm/memory.h | 5 + > arch/arm/include/asm/pgalloc.h | 8 +- > arch/arm/include/asm/string.h | 21 ++ > arch/arm/include/asm/thread_info.h | 8 + > arch/arm/include/asm/uaccess-asm.h | 2 +- > arch/arm/kernel/entry-armv.S | 3 +- > arch/arm/kernel/entry-common.S | 9 +- > arch/arm/kernel/head-common.S | 7 +- > arch/arm/kernel/setup.c | 2 + > arch/arm/kernel/unwind.c | 6 +- > arch/arm/lib/memcpy.S | 3 + > arch/arm/lib/memmove.S | 5 +- > arch/arm/lib/memset.S | 3 + > arch/arm/mm/Makefile | 5 + > arch/arm/mm/kasan_init.c | 284 ++++++++++++++++++ > arch/arm/mm/mmu.c | 18 ++ > arch/arm/mm/pgd.c | 16 +- > arch/arm/vdso/Makefile | 2 + > 26 files changed, 548 insertions(+), 14 deletions(-) > create mode 100644 arch/arm/include/asm/kasan.h > create mode 100644 arch/arm/include/asm/kasan_def.h > create mode 100644 arch/arm/mm/kasan_init.c > -- Florian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel