Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1291729pxb; Fri, 21 Jan 2022 14:32:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBVf8YukD4FNx3z5Bfle4O7sUiFdsHI5YxuNWZwCR6IkbewLN+Vdr8VVnA54c++Lr41NXI X-Received: by 2002:a63:1462:: with SMTP id 34mr4301205pgu.229.1642804353417; Fri, 21 Jan 2022 14:32:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642804353; cv=none; d=google.com; s=arc-20160816; b=XCJtuHdjOHepdbp31x9kJ14fUsq4Hw7qUIC7L3UXTkTKI9qlkD7svn4qt6XqboRnau YbzvpRBdHvJWRheCls8mQhBDRsx8yR35J5XnzEE9VkJBFQZcNxVwZl7aOSvLDimhCVus uXJdAfX0vmnCO9ButT/AeX+f3n/dHhBd3dY6UzkUBI9GzGnhPUSUhG0LhdRuYTZZOQSg sPNnP211BvNdinHoBRDXIP+FpJ81DWm3zpRtXRZpbwGWn+5WKclMZAjdvy2++F+DBWzl TpcZDJmaWzWswDS/G9Z7PVRmIOsBcbM6m+PUEiXGSOhIFBx7YxhmS+/rOu61nUwa85Wg bc2w== 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=jA3CkCc0pg/2NQ16pdnmk4INkOngIqZyjRj6CQv0y+c=; b=P0L2C30fsKO2dRYS41tDNHRaG3ZTdD+LmBi6oYf7kb3m0mN2EFZIuTpkE617YzCaJN sAU89jFOlbsxowC7sPYAq9JmEs02GM8MFiuYFRFlK1mJcDMQ8XRR49CAt0NyMBxnv8Am alsxWWwm2q2yQLVugREa+FIVt6QavAIe2enDcjrhd0FLctow8SlsWAO3u+z/TJxhHq6M Ns44JyStr0bPLN7tJsvwBbouZ+ji6rA5436VaRUc5361OF6CKN3bokRI+CCONkROSA8o lnHzv/kYLh/Qj7QXVmkCp2m1Mp6eUTqEd/XWYk4gPBfPKyRTKb7vgDVSQIDxcWVm+Zgb nVfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=mWrA67bm; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f198si6671776pfa.347.2022.01.21.14.32.17; Fri, 21 Jan 2022 14:32:33 -0800 (PST) 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=@infradead.org header.s=casper.20170209 header.b=mWrA67bm; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235405AbiATTEt (ORCPT + 99 others); Thu, 20 Jan 2022 14:04:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377432AbiATTEt (ORCPT ); Thu, 20 Jan 2022 14:04:49 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BC33C061574 for ; Thu, 20 Jan 2022 11:04:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=jA3CkCc0pg/2NQ16pdnmk4INkOngIqZyjRj6CQv0y+c=; b=mWrA67bmZ0wgwVuAnDToH7NT5L tpqZLXGiB06qrUdIo/Eh+0EBZy1NY/6RkcOWEE2CSGzDZeta6FEVqX3aFaR/K/cgEzkCURbyCD9j1 4kB5POQ3MscqS9I+15ByHaaZJrQQdTFwqoQArQr4C9zMoQ91/ydTCGyTuKibrGb7F1w2c+uKMxm8A cYMDAg13wAtDIWELgkBXA8gRB6lnvzC16bBEnhLcr1VCeMQ1d+zEsIuHLbk+K6pxftU2oXYyouM0o LjGakAXEFB6UBVZREtLN9c5XnlCUcA/KAbZGEadfng+aImnIlZUPZncJn2zA9jsFEBpk9s5mgUJXu Ar4ls3yw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAcjS-00EcJJ-4B; Thu, 20 Jan 2022 19:04:26 +0000 Date: Thu, 20 Jan 2022 19:04:26 +0000 From: Matthew Wilcox To: "Russell King (Oracle)" Cc: Robin Murphy , Yury Norov , Catalin Marinas , Will Deacon , Andrew Morton , Nicholas Piggin , Ding Tianhong , Anshuman Khandual , Alexey Klimov , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] vmap(): don't allow invalid pages Message-ID: References: <20220118235244.540103-1-yury.norov@gmail.com> <319b09bc-56a2-207f-6180-3cc7d8cd43d1@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 20, 2022 at 04:54:03PM +0000, Russell King (Oracle) wrote: > Well, I think I've adequately explained why I believe: > > pfn_is_valid(page_to_pfn(page)) > > being used as the primary check is substandard, and will likely lead to > a future CVE. When generating an array of struct page's, I believe that > it is the responsibility for the generator to ensure that the array > only contains valid pages. So you're saying that virt_to_page() should be made more expensive?