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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 319B8C433F5 for ; Fri, 12 Nov 2021 14:27:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 03E6260F0F for ; Fri, 12 Nov 2021 14:27:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 03E6260F0F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=t33PV5AwzuX82WZvW0W2GbAp+X+9I8W4YWOrH37FpTU=; b=2VhdHeu7aNKsdk uGqOyHMjUXQh2GzSYZHYvh0YSCpa/NH2r7U7CUyhyqFuqAwi4zlaPYeiruZ3XrwqZsliXQb/L+h25 ifIgnwXZe/MeT4XR2PDN4RrdjYXgtwncaMCQOMfyXOAw/QpGAvuByTK0nS3OdEdzI+MIdCA6UwRdT LLsjbvDsIaXTfBmm4bxnDzfBLj0kpf+stUmldCZuoImcUJFzLh5cBiAh+uv6WESGdCsDE7aHUxou1 MIwKZRHxml0FHhuU5KZnHVBaKd8UZNKtTMl36+aT4FrYIPFFlQey7l/PNVjK1Ks6tbr+f8sANH//m bEGwFIdkJAubRqqPsypQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mlXVS-00Akkk-4F; Fri, 12 Nov 2021 14:26:18 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mlXVN-00Akim-Co for linux-arm-kernel@lists.infradead.org; Fri, 12 Nov 2021 14:26:14 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id BA7DC60FBF; Fri, 12 Nov 2021 14:26:11 +0000 (UTC) Date: Fri, 12 Nov 2021 14:26:08 +0000 From: Catalin Marinas To: Pingfan Liu Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Will Deacon , Pasha Tatashin , James Morse , Matthias Brugger Subject: Re: [PATCHv2] arm64: mm: Fix VM_BUG_ON(mm != &init_mm) for trans_pgd Message-ID: References: <20211111060316.12438-1-kernelfans@gmail.com> <20211112052214.9086-1-kernelfans@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211112052214.9086-1-kernelfans@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211112_062613_480552_E467C30E X-CRM114-Status: GOOD ( 14.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Fri, Nov 12, 2021 at 01:22:14PM +0800, Pingfan Liu wrote: > trans_pgd_create_copy() can hit "VM_BUG_ON(mm != &init_mm)" in the > function pmd_populate_kernel(). > > This is the combined consequence of commit 5de59884ac0e ("arm64: > trans_pgd: pass NULL instead of init_mm to *_populate functions"), which > replaced &init_mm with NULL and commit 59511cfd08f3 ("arm64: mm: use XN > table mapping attributes for user/kernel mappings"), which introduced > the VM_BUG_ON. > > Since the former sounds reasonable, it is better to work on the later. > From the perspective of trans_pgd, two groups of functions are > considered in the later one: > > pmd_populate_kernel() > mm == NULL should be fixed, else it hits VM_BUG_ON() > p?d_populate() > mm == NULL means PXN, that is OK, since trans_pgd only copies a > linear map, no execution will happen on the map. > > So it is good enough to just relax VM_BUG_ON() to disregard mm == NULL > > Fixes: 59511cfd08f3 ("arm64: mm: use XN table mapping attributes for user/kernel mappings") Cc: # 5.13.x > Signed-off-by: Pingfan Liu > Cc: Catalin Marinas > Cc: Ard Biesheuvel > Cc: Will Deacon > Cc: Pasha Tatashin > Cc: James Morse > Cc: Matthias Brugger > To: linux-arm-kernel@lists.infradead.org It looks fine to me. Reviewed-by: Catalin Marinas I'll leave it to Will to queue as a fix. Thanks. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel