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 92DAAC43334 for ; Tue, 19 Jul 2022 23:14:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B28256B0072; Tue, 19 Jul 2022 19:13:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AD86B6B0073; Tue, 19 Jul 2022 19:13:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9C75D6B0074; Tue, 19 Jul 2022 19:13:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 8E4A36B0072 for ; Tue, 19 Jul 2022 19:13:59 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 60EA38031A for ; Tue, 19 Jul 2022 23:13:59 +0000 (UTC) X-FDA: 79705404198.12.04E64F7 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf16.hostedemail.com (Postfix) with ESMTP id E1821180068 for ; Tue, 19 Jul 2022 23:13:58 +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 dfw.source.kernel.org (Postfix) with ESMTPS id DF39C60E08; Tue, 19 Jul 2022 23:13:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6B1FC341C6; Tue, 19 Jul 2022 23:13:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1658272437; bh=L5uy3KHKIgaKuNoQ+k1PIKdYCBx322IETWpRn30VZL8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=vS3AUKtyvUDiPNJUpNWXZbpJc3ggvVA8/DDdq9XUpTgTaxTdfTUBYHI/0xA3Yg3py Emrhi7WHgQoD9OaUgIet25oA0aytcS1SHctEHD34nvX4Y63rBLFOfljturqf1HNx+8 BI9olIM2Q6hqRLmbHPfI7Ww+rPDEOx98r7mgb+fk= Date: Tue, 19 Jul 2022 16:13:56 -0700 From: Andrew Morton To: Marco Elver Cc: Geert Uytterhoeven , yee.lee@mediatek.com, Linux Kernel Mailing List , Catalin Marinas , Alexander Potapenko , Dmitry Vyukov , Matthias Brugger , "open list:KFENCE" , "open list:MEMORY MANAGEMENT" , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" , Dave Hansen Subject: Re: [PATCH v2 1/1] mm: kfence: apply kmemleak_ignore_phys on early allocated pool Message-Id: <20220719161356.df8d7f6fc5414cc9cc7f8302@linux-foundation.org> In-Reply-To: References: <20220628113714.7792-1-yee.lee@mediatek.com> <20220628113714.7792-2-yee.lee@mediatek.com> <20220715163305.e70c8542d5e7d96c5fd87185@linux-foundation.org> 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-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=vS3AUKty; dmarc=none; spf=pass (imf16.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658272439; 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=uAsVG6vHuHUdQms58NLVb9AElblSH0zMsR0cP5n0bt4=; b=CoqAX9qz8zpdSSxubmcCpAyW99RjHxV/BfM/R50yrrK9VC35BrHE5DAjR2pXTCCufXKtxc NvO5ig491Aq1v6pSHuQRyHa5FlveyX7jYBKE6qngQKUmVrkp//fQN0hPWZQ1gSW3XOG+8l 63xjwjgC4ZNwRtGx4FvwKxAXwXU5DPs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658272439; a=rsa-sha256; cv=none; b=gAeA9S2urJaXh4wnLE6nz4/SMlxAgK7CzYU5DWVBt6SCtt/+ur+b+m80/NzgIpTcbd+tjw piId64qbo+vLDz4A6vUtqFwbSxOEsnIohmOXpmxHsjY2zvh+BNV2tAeHsBEprLmi2eAB4y 8aGYG9RZwA1mFwE8az920yxx5JxRxL0= X-Rspamd-Queue-Id: E1821180068 Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=vS3AUKty; dmarc=none; spf=pass (imf16.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: wq3wwj7bscqdeexrrhyu6n8qiskd78m1 X-HE-Tag: 1658272438-485845 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 Mon, 18 Jul 2022 16:26:25 +0200 Marco Elver wrote: > On Sat, 16 Jul 2022 at 20:43, Geert Uytterhoeven wrote: > [...] > > > - 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? > > > > I think all of this is highly architecture-specific... > > The report can be reproduced on i386 with CONFIG_X86_PAE=y. But e.g. > mm/memblock.c:memblock_free() is also guilty of using __pa() on > previously memblock_alloc()'d addresses. Looking at the phys addr > before memblock_alloc() does virt_to_phys(), the result of __pa() > looks correct even on PAE, at least for the purpose of passing it on > to kmemleak(). So I don't know what that BUG_ON(slow_virt_to_phys() != > phys_addr) is supposed to tell us here. > It's only been nine years, so I'm sure Dave can remember why he added it ;) BUG_ON(slow_virt_to_phys((void *)x) != phys_addr); in arch/x86/mm/physaddr.c:__phys_addr(). This kfence patch does seem to be desirable, but we can't proceed if it's resulting in kernel crashes.