Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6356300pxb; Tue, 15 Feb 2022 00:05:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCD1aZtxyfsED0RTSC1DLsGcC4lcTP88pf8R+tRpc4bz5FEjZuRWxr/LH3rE/Fy5Qfnj6v X-Received: by 2002:aa7:c156:: with SMTP id r22mr2610770edp.253.1644912322785; Tue, 15 Feb 2022 00:05:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644912322; cv=none; d=google.com; s=arc-20160816; b=uKLksUPs4s3kryqT84LIS9oSZOa/hE5M0hwcENninbrbCVeCkvRWj9CSXPBO4KSkbf eMb8JUFJelUnOnpSo3ArQR0kEQp16g3YPYW1Il0fKeqVBTaNHJnxCTVKPw5T2JX7UTEO ZSfZv5+OHRoQfTYDo45BHrnzwJxUIhiIrBP1iRZ6j433GiHxognc0BBHbtmPRQvTEJ6y JX7k+Ur/PMTbsTDNWZBzf8+X/aU4ntAzDJqh5WJk8cUa3N4v9Ire+3Zx8HkOa91kGbmX oH2CPgS5bgP6O70Fa3ZeUMVmke3dvqX53zenGN3vpQSkw2vE+xC6lQTjhddHWmosLJvx Bozw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :message-id:subject:references:in-reply-to:to:from; bh=VHAMcvtSat6SBjziPayV4E8pNM6BNY2NEhuRmpxU0fg=; b=uMI+XU1nSwvukaGX1rz4Xn1C6WO6P0TPnJ1VrSUs1h3GC9BNzwEwiNt7SbvrqIigZZ aBIo+V4BK2LfIzvVbmjVSF0Y0YqQFonOH42ivYIU0istcQBFihVhE1Ym8AUhHWFwRrpl NlOnvWiVFf0jFdQCmH6y9+9HdoMcHshMkz7Ld3QTmY5jpYvsYc0HkQaYNY5sMusbo3vH e/fzLwqakfjV/pi5K/+2rPfTB2YQqXkj/2fIrCCaHvYL8V3EMXlG0taPY5Nnfg9RRBUe j6y/4ebCa6HyjOPcN0h+Zkif/nlFa9S+qTypXNU2ou/Mg3WwyPLezxaKsGShhDx7Tc1x ko/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id el14si19317169edb.538.2022.02.15.00.04.59; Tue, 15 Feb 2022 00:05:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234024AbiBOFaV (ORCPT + 99 others); Tue, 15 Feb 2022 00:30:21 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:57554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233219AbiBOFaQ (ORCPT ); Tue, 15 Feb 2022 00:30:16 -0500 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3116C1216A9 for ; Mon, 14 Feb 2022 21:30:07 -0800 (PST) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4JyV6454LFz4y3t; Tue, 15 Feb 2022 16:30:04 +1100 (AEDT) From: Michael Ellerman To: Benjamin Herrenschmidt , Chen Jingwen , kasan-dev , linuxppc-dev@lists.ozlabs.org, Michael Ellerman , Paul Mackerras , linux-kernel@vger.kernel.org, Christophe Leroy In-Reply-To: <20211229035226.59159-1-chenjingwen6@huawei.com> References: <20211229035226.59159-1-chenjingwen6@huawei.com> Subject: Re: [PATCH] powerpc/kasan: Fix early region not updated correctly Message-Id: <164490280217.270256.12753879562641501185.b4-ty@ellerman.id.au> Date: Tue, 15 Feb 2022 16:26:42 +1100 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Dec 2021 11:52:26 +0800, Chen Jingwen wrote: > The shadow's page table is not updated when PTE_RPN_SHIFT is 24 > and PAGE_SHIFT is 12. It not only causes false positives but > also false negative as shown the following text. > > Fix it by bringing the logic of kasan_early_shadow_page_entry here. > > 1. False Positive: > ================================================================== > BUG: KASAN: vmalloc-out-of-bounds in pcpu_alloc+0x508/0xa50 > Write of size 16 at addr f57f3be0 by task swapper/0/1 > > [...] Applied to powerpc/next. [1/1] powerpc/kasan: Fix early region not updated correctly https://git.kernel.org/powerpc/c/dd75080aa8409ce10d50fb58981c6b59bf8707d3 cheers