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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20294C433E0 for ; Sat, 20 Feb 2021 17:40:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D861B64E86 for ; Sat, 20 Feb 2021 17:40:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229871AbhBTRjt (ORCPT ); Sat, 20 Feb 2021 12:39:49 -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...