Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1602274pxb; Fri, 27 Aug 2021 12:39:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2+D9msZytk5JcTSS5MDLVKo8erjHMCGEk4oBY7NgFfwHoBMsP+k7LJHLBp1t5nBvhnL0u X-Received: by 2002:a92:d9c2:: with SMTP id n2mr7561242ilq.214.1630093192765; Fri, 27 Aug 2021 12:39:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630093192; cv=none; d=google.com; s=arc-20160816; b=exSgHb0YWottR9mMgOdeyq8EmL2c9c0WUr8MmH2pktgoKQze8NvafNmuJgQrrXoV7C t2MR4PyNwnwOyr5aBuEfPvRsa6O7KrTEHz4JxZKh+uL7+wI+HUx/s7iJyPWjDEbpomtS HChrxP8+6SwnzrjTcKiv4pm8eJjsPhu1Y7WYzHQX1w7lBau93o+JLJFsS1rjGLubDMBJ 3RbvoyK2SbPF4zQ14X/7j0wuK6tsTKJeEBsWD4XZyguxbNAXgoZFLmnIMm/nxei6nknb bAEFYwQPBX405AdYEYr2qEdkx4gmrXIEyP9MhxGFWRfHdu797N/LxhEoJ2EWRAiYbbqp NPwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=qiDNYGUe2jV338/O7J6Hqi37J/Mos9WLo//lQ29h6YE=; b=vtglZriWhExGiDOFkdaHtiCrdicJhk5gD1Xiuw19P9B1/CTARFms5KPTh3MdRWSLVT cskPk8Lvt9Pun8K37I8ljiWTC7XwmQMTWJmUo8qPBcLpZiAsEdG7WiQOE4BsP+T+mHz0 6DjquFmS6K2j8zU+z1EHbds97e+WLOrimJIG2HhAVHvExC+VFjsXrZNUZyCbo1vZDIG8 /86kWMuQ1kY1cWbxo/JsApR2z6trVBulI6jpLEkpKRebBNKCf0DL0aGjzZOUjbHj1Pp9 ZF6bMzFpKH6KukaSEBZFctGNgmnDhBdG5WE/B837pCxD0EGBcn0bffL/2u7Xnq9I5FQb XkMw== ARC-Authentication-Results: i=1; mx.google.com; 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 j19si7315906iow.12.2021.08.27.12.39.21; Fri, 27 Aug 2021 12:39:52 -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; 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 S231267AbhH0TiX (ORCPT + 99 others); Fri, 27 Aug 2021 15:38:23 -0400 Received: from zeniv-ca.linux.org.uk ([142.44.231.140]:43162 "EHLO zeniv-ca.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230005AbhH0TiX (ORCPT ); Fri, 27 Aug 2021 15:38:23 -0400 Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJhfJ-00GZrY-Mi; Fri, 27 Aug 2021 19:37:25 +0000 Date: Fri, 27 Aug 2021 19:37:25 +0000 From: Al Viro To: Linus Torvalds Cc: Andreas Gruenbacher , Christoph Hellwig , "Darrick J. Wong" , Jan Kara , Matthew Wilcox , cluster-devel , linux-fsdevel , Linux Kernel Mailing List , ocfs2-devel@oss.oracle.com Subject: Re: [PATCH v7 05/19] iov_iter: Introduce fault_in_iov_iter_writeable Message-ID: References: <20210827164926.1726765-1-agruenba@redhat.com> <20210827164926.1726765-6-agruenba@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 27, 2021 at 12:33:00PM -0700, Linus Torvalds wrote: > On Fri, Aug 27, 2021 at 12:23 PM Al Viro wrote: > > > > Could you show the cases where "partial copy, so it's OK" behaviour would > > break anything? > > Absolutely. > > For example, i t would cause an infinite loop in > restore_fpregs_from_user() if the "buf" argument is a situation where > the first page is fine, but the next page is not. > > Why? Because __restore_fpregs_from_user() would take a fault, but then > fault_in_pages_readable() (renamed) would succeed, so you'd just do > that "retry" forever and ever. > > Probably there are a number of other places too. That was literally > the *first* place I looked at. OK... Let me dig out the notes from the last time I looked through that area and grep around a bit. Should be about an hour or two.