Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp962763imw; Fri, 15 Jul 2022 16:58:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tV+VWx5f5SEWk5m+of70j1CENLlASSSvjQl6c7bDeq1KneogTTL0xTI5Ox5ehGZJvcIzEr X-Received: by 2002:a63:f91e:0:b0:419:e9dd:6d97 with SMTP id h30-20020a63f91e000000b00419e9dd6d97mr3676045pgi.116.1657929522146; Fri, 15 Jul 2022 16:58:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657929522; cv=none; d=google.com; s=arc-20160816; b=Lp6qgA3Mda3VEmPONio5sqyTJOdPzpJ9tzjHzw2SinaxDyaA97WHRfahy+8fgMuOpE msrPkgsRUYcjV99R+gDTodubLMesc1DLfDIEdjy1oUDVkm2ty9rDi6sq7xkC8zNP2WLU M1/oZRWVe+cerXfFiDiaas8Nr+nqdZDE2DyBF0F9KPNz0RzdYXqqMGGcQ/nkVq8Qxr1z z8eZgvPQr9N3nZ5Stg5ILShI47mOrPeWuWlmzQWYlepX36TyFr0zScDnm+j+yhQrwCk4 /Z0NYvK3tVspKIUOoHxeYYw7L91exZdVhBjeTGAX3Lef2aNM7+ZVHkz2Pd16tWpToCNE 0TEg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=wsCJf+W80m4JnOYQTNwvFXoXyL6yxh+A6mqqU7DJVBs=; b=GN9y5OVG4nXD08sHY7TjMa/pZOkoyBtIcirLl0O3mRcVFDnVyePrTE74JxQOjikGg8 wrbxWloKLgZpdtPyhXBLRbW2agz0Se3JAFb+PqanuUnWgl0B+ZL5gR2JCbOGUroDPAJP f9g8fRAsE5fyAFV6g4oiivtXzfxMu5Mn1ACMi2PU4XIoGqdn1XCxRVI3KhWXy5Qkyo7i SCnR1AY2hHU8p7AFOjBQCZUg6RLgSIXQqXNMBGNKDgIDgwXbkC3gsBvS17wisnNxnBp9 UPcNuPC1WkJ18oFuHuXVCxk4i+zpfiBJ525JrHSt5oMqmy3VldStWVpOb9JHx6SK5iuA S2dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="FEnapZq/"; 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 d190-20020a6336c7000000b003fe494520a9si7539412pga.357.2022.07.15.16.58.27; Fri, 15 Jul 2022 16:58:42 -0700 (PDT) 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; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="FEnapZq/"; 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 S232659AbiGOXdL (ORCPT + 99 others); Fri, 15 Jul 2022 19:33:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231266AbiGOXdK (ORCPT ); Fri, 15 Jul 2022 19:33:10 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7501012AF9 for ; Fri, 15 Jul 2022 16:33:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id E928BCE30C4 for ; Fri, 15 Jul 2022 23:33:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5B59C34115; Fri, 15 Jul 2022 23:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1657927986; bh=C2b3YLrjkNeagDR8DxwpKkhSaFC5JfY7+Rq4F/K+LUM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FEnapZq/UkEN2jjYPl8+26kKS3k5gOPiKVO0480IXNXy2jy8Fv0LNLk5zZKQEjRrd 7uGrChARWx5XIGasYrEq7mh0U8jZqSDuZSVl6LlXXIqHcVq9FN9LzLQkQsozA42DTC uB/aBzyjZrXApZE1z7dWbS9MuKm4D+hzdrGkWso0= Date: Fri, 15 Jul 2022 16:33:05 -0700 From: Andrew Morton To: Geert Uytterhoeven Cc: yee.lee@mediatek.com, Linux Kernel Mailing List , Catalin Marinas , Alexander Potapenko , Marco Elver , Dmitry Vyukov , Matthias Brugger , "open list:KFENCE" , "open list:MEMORY MANAGEMENT" , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" , Marco Elver , Catalin Marinas Subject: Re: [PATCH v2 1/1] mm: kfence: apply kmemleak_ignore_phys on early allocated pool Message-Id: <20220715163305.e70c8542d5e7d96c5fd87185@linux-foundation.org> In-Reply-To: References: <20220628113714.7792-1-yee.lee@mediatek.com> <20220628113714.7792-2-yee.lee@mediatek.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Fri, 15 Jul 2022 10:17:43 +0200 Geert Uytterhoeven wrote: > On Tue, Jun 28, 2022 at 1:42 PM wrote: > > From: Yee Lee > > > > This patch solves two issues. > > > > (1) The pool allocated by memblock needs to unregister from > > kmemleak scanning. Apply kmemleak_ignore_phys to replace the > > original kmemleak_free as its address now is stored in the phys tree. > > > > (2) The pool late allocated by page-alloc doesn't need to unregister. > > Move out the freeing operation from its call path. > > > > Suggested-by: Catalin Marinas > > Suggested-by: Marco Elver > > Signed-off-by: Yee Lee > > Thank you, this fixes the storm of > > BUG: KFENCE: invalid read in scan_block+0x78/0x130 > BUG: KFENCE: use-after-free read in scan_block+0x78/0x130 > BUG: KFENCE: out-of-bounds read in scan_block+0x78/0x130 > > messages I was seeing on arm64. Thanks, but... - It would be great if we could identify a Fixes: for this. - This patch has been accused of crashing the kernel: https://lkml.kernel.org/r/YsFeUHkrFTQ7T51Q@xsang-OptiPlex-9020 Do we think that report is bogus?