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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26C81C433EF for ; Fri, 15 Jul 2022 23:33:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 668E28E000C; Fri, 15 Jul 2022 19:33:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 617F48E0009; Fri, 15 Jul 2022 19:33:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4DFAF8E000C; Fri, 15 Jul 2022 19:33:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 3AA568E0009 for ; Fri, 15 Jul 2022 19:33:10 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 0EFF134BC4 for ; Fri, 15 Jul 2022 23:33:10 +0000 (UTC) X-FDA: 79690937340.02.8F9918A Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf20.hostedemail.com (Postfix) with ESMTP id 8FCDE1C007C for ; Fri, 15 Jul 2022 23:33:09 +0000 (UTC) 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 ams.source.kernel.org (Postfix) with ESMTPS id 96AAAB82F01; 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657927989; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=wsCJf+W80m4JnOYQTNwvFXoXyL6yxh+A6mqqU7DJVBs=; b=IpMC77LkbCwrE+SKaUmg/fPHMMyhlxXhz8amKm05gtjdz+P+pePo8GS+utlwdwrtWWViHw LQalRQrYBj25y91r4urF4ijct0L+pgzLUnG6GkAo76HCEI7bVgoo/68NXVMX4SRl6VnS+6 wMnHOLSqA759e4i6Qgn9mZs01uoKAq8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657927989; a=rsa-sha256; cv=none; b=xto8YvmcVhPNJrQ9lck0nhIc2CWxdTn4kEq751GXq14+2m16zuKZBU2Tphx1LnlHLJOVA5 USgsUnyDNcZMjThia0V0S0lmelz+NDgRBIbpGQyzS5PWekrh9Q1+uL0JYXK6Bid4q9d7rH QX7JyRX3B0PRY8d80RSS1JeiNWbCrkA= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="FEnapZq/"; spf=pass (imf20.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="FEnapZq/"; spf=pass (imf20.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Queue-Id: 8FCDE1C007C X-Stat-Signature: hrapdf41xt7hhqfyrgrtrz9a18r7a8ws X-Rspam-User: X-Rspamd-Server: rspam12 X-HE-Tag: 1657927989-172077 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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?