From: David Howells <dhowells@redhat.com>
To: Jann Horn <jannh@google.com>
Cc: dhowells@redhat.com,
syzbot <syzbot+011e4ea1da6692cf881c@syzkaller.appspotmail.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk
Subject: Re: [syzbot] possible deadlock in pipe_write
Date: Mon, 21 Mar 2022 16:03:48 +0000 [thread overview]
Message-ID: <1037989.1647878628@warthog.procyon.org.uk> (raw)
In-Reply-To: <CAG48ez2AAk6JpZAA6GPVgvCmKimXHJXO906e=r=WGU06k=HB3A@mail.gmail.com>
Jann Horn <jannh@google.com> wrote:
> The syz reproducer is:
>
> #{"threaded":true,"procs":1,"slowdown":1,"sandbox":"","close_fds":false}
> pipe(&(0x7f0000000240)={<r0=>0xffffffffffffffff, <r1=>0xffffffffffffffff})
> pipe2(&(0x7f00000001c0)={0xffffffffffffffff, <r2=>0xffffffffffffffff}, 0x80)
> splice(r0, 0x0, r2, 0x0, 0x1ff, 0x0)
> vmsplice(r1, &(0x7f00000006c0)=[{&(0x7f0000000080)="b5", 0x1}], 0x1, 0x0)
>
> That 0x80 is O_NOTIFICATION_PIPE (==O_EXCL).
>
> It looks like the bug is that when you try to splice between a normal
> pipe and a notification pipe, get_pipe_info(..., true) fails, so
> splice() falls back to treating the notification pipe like a normal
> pipe - so we end up in iter_file_splice_write(), which first locks the
> input pipe, then calls vfs_iter_write(), which locks the output pipe.
>
> I think this probably (?) can't actually lead to deadlocks, since
> you'd need another way to nest locking a normal pipe into locking a
> watch_queue pipe, but the lockdep annotations don't make that clear.
Is this then a bug/feature in iter_file_splice_write() rather than in the
watch queue code, per se?
David
next prev parent reply other threads:[~2022-03-21 16:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-21 2:34 syzbot
2022-03-21 14:41 ` Jann Horn
2022-03-21 16:03 ` David Howells [this message]
2022-03-21 16:17 ` Jann Horn
2023-11-24 14:38 ` Jann Horn
2023-11-24 15:03 ` [syzbot] [fs?] " 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=1037989.1647878628@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=jannh@google.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+011e4ea1da6692cf881c@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
all inboxes | Powered by JetHome®