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 4268EC433F5 for ; Mon, 31 Jan 2022 19:27:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BB0FD6B00F1; Mon, 31 Jan 2022 14:27:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B6B6D6B00F3; Mon, 31 Jan 2022 14:27:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A016B6B00F4; Mon, 31 Jan 2022 14:27:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0081.hostedemail.com [216.40.44.81]) by kanga.kvack.org (Postfix) with ESMTP id 8BBB16B00F1 for ; Mon, 31 Jan 2022 14:27:40 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 44B1F93F1D for ; Mon, 31 Jan 2022 19:27:40 +0000 (UTC) X-FDA: 79091566680.06.52A37DA Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf07.hostedemail.com (Postfix) with ESMTP id 58CAC40002 for ; Mon, 31 Jan 2022 19:27:39 +0000 (UTC) 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=zAIKK08Tys6NkLC1tOuXVqp66nRrGOyO0fBWLyvmg9Y=; b=T+rJwx3QXKyIM9LTF9r16Zcr0t Y3Xphd22uXctgfTZTTPKZuHwgwi0x4L1NJkbtcRuyejTcJNQ4RrlUNybGug4NsAxxEeEoiaOq9Aa9 kBp23Y9Nr5ptVymGh5n84YkhbVGWMf3Pqq8gIQoRJU3vcRMAAvYQfkUMK2OoZ+XNESlC8g0vqmze4 uoTnZOWB3vV4XPPS6h1UjJXbUMSEWduoCIwRlksUj8Qc1h3W5rF/ss0AC9tYNMDrOiNGBEzdU7Yji ainlZ4X9T3vJcRakoc82iY3TKRDHgDok5zd4/BUWKuIFyR/oxcs8HBfpebyGooG6VbzYz/hmNjwq1 /X9N/D6g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nEcKt-00ATke-Cg; Mon, 31 Jan 2022 19:27:35 +0000 Date: Mon, 31 Jan 2022 19:27:35 +0000 From: Matthew Wilcox To: David Hildenbrand Cc: Kees Cook , linux-mm@kvack.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH 4/4] usercopy: Remove HARDENED_USERCOPY_PAGESPAN Message-ID: References: <20220110231530.665970-1-willy@infradead.org> <20220110231530.665970-5-willy@infradead.org> <2858cfa9-2329-6da9-82b8-643f29d548e6@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2858cfa9-2329-6da9-82b8-643f29d548e6@redhat.com> X-Rspam-User: nil X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 58CAC40002 X-Stat-Signature: gbfuu5743wi6dr6jaqs1c5dkmgksi4wf Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=T+rJwx3Q; spf=none (imf07.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-HE-Tag: 1643657259-146153 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, Jan 31, 2022 at 03:27:02PM +0100, David Hildenbrand wrote: > On 11.01.22 00:15, Matthew Wilcox (Oracle) wrote: > > There isn't enough information to make this a useful check any more; > > the useful parts of it were moved in earlier patches, so remove this > > set of checks now. > > > > Signed-off-by: Matthew Wilcox (Oracle) > > > Very nice cleanup IMHO > > Reviewed-by: David Hildenbrand Thanks. I'm thinking about adding another check. If the order-0 page has a non-NULL ->mapping, I believe that is enough to determine that it's a page cache / KSM / Anon page, and as such is guaranteed to actually be order-0 (and not part of a postive-order allocation without __GFP_COMP set). But that would require a bit more auditing, or just throwing it in and seeing what breaks *whistles*.