Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2195067pxa; Fri, 7 Aug 2020 05:40:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRkI0JGwOvZ+RkXXFSPtPrFyW8rQOqcAE1QESh4FZM3ueBLHpM1af1338WVHz1clv2FKQX X-Received: by 2002:a50:f396:: with SMTP id g22mr8769838edm.220.1596804059265; Fri, 07 Aug 2020 05:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596804059; cv=none; d=google.com; s=arc-20160816; b=ess1e6F8Gm03XlDUpGzEP36NTnYgVHZNzXRXyqNJiyYlEWNpRLiSOHMr/nWrUtu5dS 65ffc0+9+iqA1PeJqHNaMJCBfhRg/f5nxN+Wef6CTwMP7OEIm0QJcLQWnJ4EU2SHlvqs M4ZLnlK2BNrn52cROnpgi6WwM74iqufRezfShLXCe1B6EDnP5d/sZjbb/eN7ocnGOLh/ a9L3ItFW9WTcu+Wz1ARoSia0KvOxt5zc5DJhJ4az+zSVRzSm5Uc1mdHY93rO/XNCpGTT ZeANpmqis7VGPo7TdWphNdfmPZNLO/R1YjXkg0rnnMWPF3E2bRM105o5Nd1gnFVLKZAy OiAg== 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=vuA51LqGg4Nh2J+wLzkJ9EvgoyF+rXq3Aw4TK09XPj8=; b=ibQUnDahyYAV0EF4DeODC9uyZ8TvUV6xbyGHVmgfiJVwbyulgIbI9dQ9mJ9cCIlKeG O1sn2a4qG1nNX0PY+JINf581EHIml38LUr6tQwlXJiZrgkKqMDpcgWZP9YRRYMYo0HgF EojJi65nuscBX1DDgEMO+8/BXNb81oC09OKB3h2hTo5fuRy43wJAfQdRAGElSNOQqJKU eU/aNKf+W+uUjGuvzBJn1z2ScOKDEFjQ4PfTxlsX6Tyj5UEoS5ozcV7XQB5ecLUw8KzO C6sqsBE5kRQWku/1LxBDq4zlFpGwISAaj7pXtMkolS08IMDUcFU/FYigj32hyg1UuWEZ cAlA== 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 a10si5455383ejf.666.2020.08.07.05.40.35; Fri, 07 Aug 2020 05:40:59 -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 S1728479AbgHGMjA (ORCPT + 99 others); Fri, 7 Aug 2020 08:39:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728350AbgHGMjA (ORCPT ); Fri, 7 Aug 2020 08:39:00 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2327C061574; Fri, 7 Aug 2020 05:38:59 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k41eA-00B8k0-Cv; Fri, 07 Aug 2020 12:38:54 +0000 Date: Fri, 7 Aug 2020 13:38:54 +0100 From: Al Viro To: Tetsuo Handa Cc: syzkaller-bugs@googlegroups.com, syzbot , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Ming Lei Subject: Re: splice: infinite busy loop lockup bug Message-ID: <20200807123854.GS1236603@ZenIV.linux.org.uk> References: <00000000000084b59f05abe928ee@google.com> <29de15ff-15e9-5c52-cf87-e0ebdfa1a001@I-love.SAKURA.ne.jp> <20200807122727.GR1236603@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200807122727.GR1236603@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 07, 2020 at 01:27:27PM +0100, Al Viro wrote: > On Fri, Aug 07, 2020 at 07:35:08PM +0900, Tetsuo Handa wrote: > > syzbot is reporting hung task at pipe_release() [1], for for_each_bvec() from > > iterate_bvec() from iterate_all_kinds() from iov_iter_alignment() from > > ext4_unaligned_io() from ext4_dio_write_iter() from ext4_file_write_iter() from > > call_write_iter() from do_iter_readv_writev() from do_iter_write() from > > vfs_iter_write() from iter_file_splice_write() falls into infinite busy loop > > with pipe->mutex held. > > > > The reason of falling into infinite busy loop is that iter_file_splice_write() > > for some reason generates "struct bio_vec" entry with .bv_len=0 and .bv_offset=0 > > while for_each_bvec() cannot handle .bv_len == 0. > > broken in 1bdc76aea115 "iov_iter: use bvec iterator to implement iterate_bvec()", > unless I'm misreading it... > > Zero-length segments are not disallowed; it's not all that hard to filter them > out in iter_file_splice_write(), but the intent had always been to have > iterate_all_kinds() et.al. able to cope with those. > > How are these pipe_buffers with ->len == 0 generated in that reproducer, BTW? > There might be something else fishy going on... FWIW, my preference would be to have for_each_bvec() advance past zero-length segments; I'll need to go through its uses elsewhere in the tree first, though (after I grab some sleep),