lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1037989.1647878628@warthog.procyon.org.uk>
Date:   Mon, 21 Mar 2022 16:03:48 +0000
From:   David Howells <dhowells@...hat.com>
To:     Jann Horn <jannh@...gle.com>
Cc:     dhowells@...hat.com,
        syzbot <syzbot+011e4ea1da6692cf881c@...kaller.appspotmail.com>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        syzkaller-bugs@...glegroups.com, viro@...iv.linux.org.uk
Subject: Re: [syzbot] possible deadlock in pipe_write

Jann Horn <jannh@...gle.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ