mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: dhowells@redhat.com,
	syzbot <syzbot+f527b971b4bdc8e79f9e@syzkaller.appspotmail.com>,
	bpf@vger.kernel.org, brauner@kernel.org, davem@davemloft.net,
	dsahern@kernel.org, edumazet@google.com,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, pabeni@redhat.com,
	syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk
Subject: Re: [syzbot] [fs?] INFO: task hung in pipe_release (4)
Date: Sat, 29 Jul 2023 00:52:20 +0100	[thread overview]
Message-ID: <550503.1690588340@warthog.procyon.org.uk> (raw)
In-Reply-To: <20230718160737.52c68c73@kernel.org>

Jakub Kicinski <kuba@kernel.org> wrote:

> Hi David, any ideas about this one? Looks like it triggers on fairly
> recent upstream?

I've managed to reproduce it finally.  Instrumenting the pipe_lock/unlock
functions, splice_to_socket() and pipe_release() seems to show that
pipe_release() is being called whilst splice_to_socket() is still running.

I *think* syzbot is arranging things such that splice_to_socket() takes a
significant amount of time so that another thread can close the socket as it
exits.

In this sample logging, the pipe is created by pid 7101:

[   66.205719] --pipe 7101
[   66.209942] lock
[   66.212526] locked
[   66.215344] unlock
[   66.218103] unlocked

splice begins in 7101 also and locks the pipe:

[   66.221057] ==>splice_to_socket() 7101
[   66.225596] lock
[   66.228177] locked

but for some reason, pid 7100 then tries to release it:

[   66.377781] release 7100

and hangs on the __pipe_lock() call in pipe_release():

[   66.381059] lock

The syz reproducer does weird things with threading - and I'm wondering if
there's a file struct refcount bug here.  Note that splice_to_socket() can't
access the pipe file structs to alter the refcount, and the involved pipe
isn't communicated to udp_sendmsg() in any way - so if there is a refcount
bug, it must be somewhere in the VFS, the pipe driver or the splice
infrastructure:-/.

I'm also not sure what's going on inside udp_sendmsg() as yet.  It doesn't
show a stack in /proc/7101/stacks, which means it doesn't hit a schedule().

David


  parent reply	other threads:[~2023-07-28 23:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12  7:35 syzbot
2023-07-12 18:54 ` syzbot
2023-07-18 23:07   ` Jakub Kicinski
2023-07-24 13:17   ` David Howells
2023-07-28 23:52   ` David Howells [this message]
2023-07-29 15:27   ` David Howells
2023-07-29 21:49   ` Endless loop in udp with MSG_SPLICE_READ - " David Howells
2023-07-30 13:35     ` Willem de Bruijn
2023-07-30 14:30       ` Willem de Bruijn
2023-07-30 17:32     ` David Howells
2023-07-31  8:13     ` David Howells
2023-07-31 12:45       ` Willem de Bruijn
2023-07-31 13:34       ` David Howells
2023-08-01 12:40       ` David Howells
2023-08-01 12:58         ` Willem de Bruijn
2023-08-01 13:08         ` Willem de Bruijn
2023-08-01 14:01         ` David Howells
2023-08-01 14:02         ` David Howells
2023-08-01 14:19         ` David Howells
2023-08-01 14:31           ` Willem de Bruijn
2023-08-01 14:47           ` David Howells
2023-08-01 14:59             ` Willem de Bruijn
2023-08-02 13:21   ` David Howells
2023-08-02 16:48     ` syzbot
     [not found] <20230730005526.1064-1-hdanton@sina.com>
2023-07-30  1:18 ` syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=550503.1690588340@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=bpf@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=syzbot+f527b971b4bdc8e79f9e@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome