Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp428232pxb; Wed, 8 Sep 2021 04:35:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJG5L+u3lPJViJPDjqPJ2T/WBAaWy/PTAQVprzXR6VPTFZR8TMZ9Rav2m6cPBaahdPF//d X-Received: by 2002:a92:d3cf:: with SMTP id c15mr2574879ilh.131.1631100956766; Wed, 08 Sep 2021 04:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631100956; cv=none; d=google.com; s=arc-20160816; b=DQJKSXGABlebPLZjWkBRkjzEM+WHFFxQP6957byaJvoWh3qW+Cqh5M8D4nApjknN+t lPUWS/KymQetxzfYYvZQUDOFofr73sSz7dA4clQcHAq9lanxARUdQOyFCceDk+7dqbWE VWXStzoQ93qUJ3uWHffXuk2s5Z3qY9jmeRtJdANtDITXJEybFuSASrqZGmdiUXymZWrT QswHNwZWBF3eUvJTrvxbif8cZ8cI3muo9RTYy+iah6zBnFYa0ixr9uL6bZjiBORJGIIO kwMXRGR5pobOAHwiS+xloxAfkxV7SaSKAc1wFBsS2Jl9FEkUhMMN2HVtKmR3iwI8QwNQ lKaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=m/Frv4i98ljsymrvV0/yhoTmQ0S/VberekuyvlZ3qEw=; b=KyyEa07lXI3+Z9TvaIr6MnrxULGaaDK1rUd6A9GGi5Mau9vM98YdfZy+VANmL1IbPr Q37rTEnTVDeKgefhfbvPvpYMP8k11nhfAivtHLkXDq9x8sijsOAUJeOLGsjBtwE0N6+k GI399LEp1MCiZb+lp+gf3FOVRRfrFQupfZxUfjWBvdPTElBBUtF2tCLaDAla8Koze7/q P80KNnmTYJKeDRNhjfdcO7pAPtrFelh6yWi25YDMRZhHJOrGaIYfWyaP4VhLCbkYdXsy /kCF6fNRq79vknu5f/Dl02BGj302QLUqGva4Cao1vkEHO92eKqJlQR4g59bdUTMpY0Z+ NFBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=NfKUxhqk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x19si1672279ilc.166.2021.09.08.04.35.44; Wed, 08 Sep 2021 04:35:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=NfKUxhqk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349204AbhIHLff (ORCPT + 99 others); Wed, 8 Sep 2021 07:35:35 -0400 Received: from mail.skyhub.de ([5.9.137.197]:39450 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348557AbhIHLfe (ORCPT ); Wed, 8 Sep 2021 07:35:34 -0400 Received: from zn.tnic (p200300ec2f0efc002d1ac0b1b41b9169.dip0.t-ipconnect.de [IPv6:2003:ec:2f0e:fc00:2d1a:c0b1:b41b:9169]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 69E191EC036B; Wed, 8 Sep 2021 13:34:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1631100865; h=from:from: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:in-reply-to:in-reply-to: references:references; bh=m/Frv4i98ljsymrvV0/yhoTmQ0S/VberekuyvlZ3qEw=; b=NfKUxhqk7CQNY9baqIi2HJw9km0ov3Vhu96MRbZd7TFmRoLJn/9d8b11Xk17XDIwl6B1Wg ubT9iwlULRlwmbhdS1woU5AIwJtXvDZL2VpfRLDE9rroVJfb1kI8NRVVH/gFIGNGu7QkLI 7I/ZsdGgnHAzL2v1JqKR3QArzp0xr0w= Date: Wed, 8 Sep 2021 13:34:18 +0200 From: Borislav Petkov To: Mike Rapoport Cc: Dave Hansen , x86@kernel.org, Andrew Morton , Andy Lutomirski , Dave Hansen , David Hildenbrand , Ingo Molnar , Jiri Olsa , Mike Rapoport , Oscar Salvador , Peter Zijlstra , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2] x86/mm: fix kern_addr_valid to cope with existing but not present entries Message-ID: References: <20210819132717.19358-1-rppt@kernel.org> <35f4a263-1001-5ba5-7b6c-3fcc5f93cc30@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 08, 2021 at 02:22:31PM +0300, Mike Rapoport wrote: > kern_addr_valid() wrongly uses pxy_none() rather than pxy_present() because > according to 9a14aefc1d28 ("x86: cpa, fix lookup_address") there could be > cases when page table entries exist but they are not valid. > So a call to kern_addr_valid() for an address in the direct map would oops. > > I've stopped digging at 9a14aefc1d28 (which is in v2.6.26) and added the > oldest stable we still support (4.4). > > I agree that before 4.19 it's more of a theoretical bug, but you know, > things happen... Hmmkay, I guess I should add the gist of that to the commit message so that it is explained why 4.4. I'm assuming the pxy_present() check is more strict than pxy_none() so that backporting to all stable kernels should not introduce any risks... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette