From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 51428C43457 for ; Tue, 13 Oct 2020 06:36:54 +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 C3C5C214D8 for ; Tue, 13 Oct 2020 06:36:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nU+RxRlJ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ToayBlWF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3C5C214D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ftUI27k4W0pca9F3u2D/EZqvHP16i2XtQ7ywJlxp8Rc=; b=nU+RxRlJAVtNF1ry3LthEBlqy tJK8snYFxC0sVA5psZUKq+deCULueLGDib/XjE7ta0oPsPIqEmoGsbmx8twD8iY/yhsHxRMi0zH/K uHlMsDs6dk4zeBNh2WL2pDOKJ8KmaL+Wy42SXoCDcBP0N4iAb0eiYhadocko0Xwf/d/Utvu6vqJW4 tQmz5Ji/FBgaZiGte6Ixqozu1EdtRh+K3iV7pVYBTjkOULOIhTjRY7KAKJxDscNxsBDVV9j9N7yWo bYMprvtsST4Gc/bfpMmTd2T537rn4gZAGO7hg69eSedQNMrrOmZbJbGbk+kkh4TeJoKTAotWSyrKl nLZxabyAQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSDtq-00074C-OD; Tue, 13 Oct 2020 06:35:06 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSDto-00073o-5b for linux-arm-kernel@lists.infradead.org; Tue, 13 Oct 2020 06:35:05 +0000 Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8A6D721582 for ; Tue, 13 Oct 2020 06:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602570901; bh=B7MjEPL9NpVr9hWWLSecq8cmDcNzYjElPWy9/H7vRr8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ToayBlWFqkSTyBhf1tLA3FiEnGprNuYKTTr+NIw9rERx6aC95YRE7Jd/gOpXn+LnX EQR28GftdB4VW9kMQ7jaNN1zMu7ed55Unj0PzZGeZ4o4rXbkLS33KgQxNnjQfYyr3q sbgFgfFsZsGdTJmUVPqinHk8VpiIQg0BMPNm5A9w= Received: by mail-ot1-f50.google.com with SMTP id s66so18078973otb.2 for ; Mon, 12 Oct 2020 23:35:01 -0700 (PDT) X-Gm-Message-State: AOAM531PCrPy4PMSKZ09NVSRRem4JAOsmYf7pALsd+yOpR717WxT7dXL UZa/Ug7hdnsQAApOz5vlRofh6gooEn6kIZGCNIg= X-Google-Smtp-Source: ABdhPJzRXkHSK6dNJvJmR+/H3lmxO62Yz7Dtb6BmYpptiCioBiex+m1mwHFfaYTNMR0oocy5FyQ9jG4Ywb6WwraOkfo= X-Received: by 2002:a9d:335:: with SMTP id 50mr19655657otv.90.1602570900798; Mon, 12 Oct 2020 23:35:00 -0700 (PDT) MIME-Version: 1.0 References: <20201012215701.123389-1-linus.walleij@linaro.org> <2c91be6f-fba6-6623-1063-99d8a1ae48de@gmail.com> In-Reply-To: <2c91be6f-fba6-6623-1063-99d8a1ae48de@gmail.com> From: Ard Biesheuvel Date: Tue, 13 Oct 2020 08:34:49 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/5 v15] KASan for Arm To: Florian Fainelli X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201013_023504_332490_8A9330A2 X-CRM114-Status: GOOD ( 30.41 ) 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 , Abbott Liu , Linus Walleij , Russell King , Mike Rapoport , Andrey Ryabinin , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 13 Oct 2020 at 05:22, Florian Fainelli wrote: > > > > 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! > Hi Florian, > [ 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] 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 The issue here is that the end of the shadow region being populated is not aligned to the page size, and so we never meet the stop condition in kasan_pgd_populate(), and instead, we keep iterating until we run out of memory. Does this help? --- a/arch/arm/mm/kasan_init.c +++ b/arch/arm/mm/kasan_init.c @@ -190,7 +190,7 @@ static int __init create_mapping(void *start, void *end) start, end, shadow_start, shadow_end); kasan_pgd_populate((unsigned long)shadow_start & PAGE_MASK, - (unsigned long)shadow_end, false); + PAGE_ALIGN((unsigned long)shadow_end), false); return 0; } _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel