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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5AC80C433F5 for ; Wed, 19 Jan 2022 16:28:48 +0000 (UTC) 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=KsuRlEj5pKQJohj4S8CjAqOuBGLA+c9jBbcodmDAvOk=; b=LO3chnJ0Ex/lpB UgpaX90g5V/W2jqXM08U6lYGaYxsm9THgTfWsADFKM+5ZLKTMTnn36MzxGBBy1E2oLJZP50RdMfzg OoFj5ej9qfET1a2UJRswLf1VwOcVz+kObDKAGa+GSP5OQMyasH2FHI4My0POdKjCJlmEeHFx/ExX0 Pd9YFo+gV2DoM7qK5HF8uxX+KnJfY/K3zSwnj49IfBldTe1DfY2wJ0Z1+i9sRfDUp15yCgstzxUzc scBpB+ZtmnqGSq+s0OaM84LWul+xhFrhwZv9xH7nglJnCaNZkGCzqAS9C/y3n4UEFZvadT8ZBFdub 982TtzZL96Z6WcJe+g7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nADoB-006NM2-45; Wed, 19 Jan 2022 16:27:39 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nADo9-006NKm-Dy for linux-arm-kernel@bombadil.infradead.org; Wed, 19 Jan 2022 16:27:37 +0000 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=y+niaJZsQwGraQM2Scy9GSfhLJjB89yjTH8KmflesUE=; b=hs7gAhpAa0jbycG+pHIUD140H9 MEc+Hhq9eXKkyB0ZBoX20pZhcH702XDPdl5aDHEgFlg7mw328ff9uPl/On17vMLICS7HNqXgYJj9p HkkRkhyAQLTk3OaC+Kj0EivULkAFGsg+VVrlLX+gsKLAwbCbbo4R9hfYu4l+U++XbGuNCxfGtNM9C RG8WwC6bGESqC7Io4ngPhQcqcVUodlUVvf6g88ntU95gCwbxj0HskVMh0IvZxrGp11RwR1LUoo+v/ +yVHv5m8ZevAwlTKx1WW+yL36OKShVEA9sHg+xOpGXMj5oyKLrF/4iWVSrbhD1orgxvNKPndmPDkS G0OQRXGQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nADo4-00BMnH-Eq; Wed, 19 Jan 2022 16:27:32 +0000 Date: Wed, 19 Jan 2022 16:27:32 +0000 From: Matthew Wilcox To: Robin Murphy Cc: 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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 Wed, Jan 19, 2022 at 01:28:14PM +0000, Robin Murphy wrote: > > + if (WARN_ON(!pfn_valid(page_to_pfn(page)))) > > Is it page_to_pfn() guaranteed to work without blowing up if page is invalid > in the first place? Looking at the CONFIG_SPARSEMEM case I'm not sure that's > true... Even if it does blow up, at least it's blowing up here where someone can start to debug it, rather than blowing up on first access, where we no longer have the invlid struct page pointer. I don't think we have a 'page_valid' function which will tell us whether a random pointer is actually a struct page or not. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel