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 99E05C433F5 for ; Mon, 13 Dec 2021 23:44:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1955E6B0071; Mon, 13 Dec 2021 18:44:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1449A6B0072; Mon, 13 Dec 2021 18:44:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 033E16B0074; Mon, 13 Dec 2021 18:44:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0138.hostedemail.com [216.40.44.138]) by kanga.kvack.org (Postfix) with ESMTP id E74FF6B0071 for ; Mon, 13 Dec 2021 18:44:46 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id AD2DA180ACC20 for ; Mon, 13 Dec 2021 23:44:36 +0000 (UTC) X-FDA: 78914402952.18.3C2B5A7 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf11.hostedemail.com (Postfix) with ESMTP id 770124000A for ; Mon, 13 Dec 2021 23:44:34 +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=uJin+BCLmxeMCPBXrQe1gxuez7RnlARPC1yq1vuWq+U=; b=EAlcNNg+HMCMPRBN77+zGk+NPp fblGc7bsxpLYQ7Sb6Vd868jR5NvZTS71tkDpYiiN+T8sVpG311UgA2PIqAZRa1IfwfSrlkmweDybF f+hp5SpX3XdtNjHr2jbguBFlaH4OQz9f3ouuMQ2Wsh+jJVZjev9NC9o7W9EZ0hTpW43UE68Uc6r4t tmHWZrSjZewiz0LAOp8j6GD5gx64ffMnLYR1rXsuUFr7bY57d9UVYPAyppA1m9rrNxl4I59KN3Gvs JzAq19w/FQSmPlhV11Zm2Qxq6Jtceu14J1YdjbZmTIllUlSMUQj8aRPbV4WwemPBbdz0VY3p1pid5 PxFwykbw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwuzh-00DG7f-SQ; Mon, 13 Dec 2021 23:44:33 +0000 Date: Mon, 13 Dec 2021 23:44:33 +0000 From: Matthew Wilcox To: Kees Cook Cc: linux-mm@kvack.org, Thomas Gleixner , linux-hardening@vger.kernel.org Subject: Re: [PATCH v3 3/3] mm/usercopy: Detect compound page overruns Message-ID: References: <20211213142703.3066590-1-willy@infradead.org> <20211213142703.3066590-4-willy@infradead.org> <202112131249.0D2A4A2C7@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202112131249.0D2A4A2C7@keescook> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 770124000A X-Stat-Signature: jeko6pniestggkroa1w4p4i5scade9mg Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=EAlcNNg+; spf=none (imf11.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: 1639439074-269042 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, Dec 13, 2021 at 12:52:22PM -0800, Kees Cook wrote: > On Mon, Dec 13, 2021 at 02:27:03PM +0000, Matthew Wilcox (Oracle) wrote: > > Move the compound page overrun detection out of > > CONFIG_HARDENED_USERCOPY_PAGESPAN so it's enabled for more people. > > I'd argue that everything else enabled by USERCOPY_PAGESPAN could be > removed now too. Do you want to add a 4th patch to rip that out? > > https://github.com/KSPP/linux/issues/163 I don't mind ... is it your assessment that it's not worth checking for a copy_to/from_user that spans a boundary between a reserved and !reserved page, or overlaps the boundary of rodata/bss/data/CMA? I have no basis on which to judge that, so it's really up to you.