From: Al Viro Date: Fri, 27 Aug 2021 19:37:25 +0000 Subject: [Cluster-devel] [PATCH v7 05/19] iov_iter: Introduce fault_in_iov_iter_writeable In-Reply-To: References: <20210827164926.1726765-1-agruenba@redhat.com> <20210827164926.1726765-6-agruenba@redhat.com> Message-ID: List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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.