Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp471573pxb; Sat, 20 Feb 2021 09:43:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwS2mlnrr+KcxUBkVDCnXMktDzU6Fbzai/gJkRXP9uzXCZumN8739mONLMR4UnPaSYgWmdM X-Received: by 2002:a17:906:7d2:: with SMTP id m18mr3187664ejc.145.1613842980414; Sat, 20 Feb 2021 09:43:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613842980; cv=none; d=google.com; s=arc-20160816; b=ckCVdXnSiYu1IdhBWBNPZURrzwlKNNEwNJjcnoKVfMwsozcC50TipuwAn3f3G8CX4Q CY/27O+3nmZtqYdaTNNuB3C6SyAb/tt9SJ83IXtat9l10sLFMKYf6IRKHzcUPJhXAHVY x2TaQrmhRna5IHMhfYSfL02mJ/CEm1KOYMui+gkGMdWIZwH8qEJtO6xFti/emL1UtMnW lVBEvNdixQWvPx1/GUqpFjKroPtpJah5KyqsPmbdgKQRDM+CsEHMZFpaMUo9hJBE5gHG EAoGCUirKb8jMj+LgMjhyK+v1IgSulr8L3Kzw5aUfTE1OtbFsmEgJGBjO30cv630sxyX C91Q== 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=BYl8aubrbNCY8SFaLFLjwNF+RV6FT1wIUUMqDGQQi5E=; b=BOLwvGSgxKdjDayZuk1EP555K9JJUls3BE3Zjz7fyc6EkOy6cJMYsT7ZYtaC+Kwvuk nyBukB5zGQH/QXiYeroWaDM1z0HUnMdLTzAT9g3d0RkZHUQzBg3u9JSnNZIgpHe1y7LH xxqdoDGabF+ddXNCZgOkGXGk7Xc/i72VjTDyvAK8BVRPkEhSCRa05AyBZYTFNztNjvKQ 5fo4dgE78qe6OPxe0o9HTyoH4slHTL9PO+ZDLhgOFgxXppkKECnxW8pY1IsJtLQ+8sVE 3eWHsNba+ui+XgafiE9Fm2buVreA3nZPUwBCKN33enzrK1cduvvju0Im75usCSKLqz4u Lhtw== 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 z17si8219434ejc.207.2021.02.20.09.42.23; Sat, 20 Feb 2021 09:43:00 -0800 (PST) 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 S229844AbhBTRjs (ORCPT + 99 others); Sat, 20 Feb 2021 12:39:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229784AbhBTRjs (ORCPT ); Sat, 20 Feb 2021 12:39:48 -0500 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA9FFC061574 for ; Sat, 20 Feb 2021 09:39:07 -0800 (PST) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1lDWDR-00GNt7-LN; Sat, 20 Feb 2021 17:38:49 +0000 Date: Sat, 20 Feb 2021 17:38:49 +0000 From: Al Viro To: Linus Torvalds Cc: syzbot , Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org, snovitoll@gmail.com, syzkaller-bugs@googlegroups.com Subject: Re: WARNING in iov_iter_revert (2) Message-ID: References: <0000000000001fb73f05bb767334@google.com> <0000000000000ca18b05bbc556d6@google.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 Sat, Feb 20, 2021 at 08:56:40AM -0800, Linus Torvalds wrote: > Al, > This is the "FIXME! Have Al check this!" case in do_tty_write(). You were > in on that whole discussion, but we never did get to that issue... > > There are some subtle rules about doing the iov_iter_revert(), but what's > the best way to do this properly? Instead of doing a copy_from_iter() and > then reverting the part that didn't fit in the buffer, doing a > non-advancing copy and then advancing the amount that did fit, or what? > > I still don't have power, so this is all me on mobile with html email > (sorry), and limited ability to really look closer. > > "Help me, Albi-wan Viro, you're my only hope" Will check... BTW, when you get around to doing pulls, could you pick the replacement (in followup) instead of the first pull request for work.namei? Jens has caught a braino in the last commit there...