Re: fs, net: deadlock between bind/splice on af_unix

2017-06-23 Thread Cong Wang
Hi, On Thu, Jun 22, 2017 at 10:49 AM, wrote: > I was getting below crash while running mp4. Are you sure your 3.14 kernel has my patch in this thread? commit 0fb44559ffd67de8517098 is merged in 4.10. Also, your crash is on unix_dgram_sendmsg() path, not

Re: fs, net: deadlock between bind/splice on af_unix

2017-02-09 Thread Cong Wang
On Tue, Feb 7, 2017 at 6:20 AM, Mateusz Guzik wrote: > > Yes, but unix_release_sock is expected to leave the file behind. > Note I'm not claiming there is a leak, but that racing threads will be > able to trigger a condition where you create a file and fail to bind it. > Which

Re: fs, net: deadlock between bind/splice on af_unix

2017-02-07 Thread Mateusz Guzik
On Sun, Feb 05, 2017 at 11:22:12PM -0800, Cong Wang wrote: > On Tue, Jan 31, 2017 at 10:14 AM, Mateusz Guzik wrote: > > On Mon, Jan 30, 2017 at 10:44:03PM -0800, Cong Wang wrote: > >> Mind being more specific? > > > > Consider 2 threads which bind the same socket, but with

Re: fs, net: deadlock between bind/splice on af_unix

2017-02-05 Thread Cong Wang
On Tue, Jan 31, 2017 at 10:14 AM, Mateusz Guzik wrote: > On Mon, Jan 30, 2017 at 10:44:03PM -0800, Cong Wang wrote: >> Mind being more specific? > > Consider 2 threads which bind the same socket, but with different paths. > > Currently exactly one file will get created, the one

Re: fs, net: deadlock between bind/splice on af_unix

2017-01-31 Thread Mateusz Guzik
On Mon, Jan 30, 2017 at 10:44:03PM -0800, Cong Wang wrote: > On Thu, Jan 26, 2017 at 10:41 PM, Mateusz Guzik wrote: > > On Thu, Jan 26, 2017 at 09:11:07PM -0800, Cong Wang wrote: > >> On Thu, Jan 26, 2017 at 3:29 PM, Mateusz Guzik wrote: > >> > Currently the

Re: fs, net: deadlock between bind/splice on af_unix

2017-01-30 Thread Cong Wang
On Thu, Jan 26, 2017 at 10:41 PM, Mateusz Guzik wrote: > On Thu, Jan 26, 2017 at 09:11:07PM -0800, Cong Wang wrote: >> On Thu, Jan 26, 2017 at 3:29 PM, Mateusz Guzik wrote: >> > Currently the file creation is potponed until unix_bind can no longer >> > fail

Re: fs, net: deadlock between bind/splice on af_unix

2017-01-26 Thread Mateusz Guzik
On Thu, Jan 26, 2017 at 09:11:07PM -0800, Cong Wang wrote: > On Thu, Jan 26, 2017 at 3:29 PM, Mateusz Guzik wrote: > > On Tue, Jan 17, 2017 at 01:21:48PM -0800, Cong Wang wrote: > >> On Mon, Jan 16, 2017 at 1:32 AM, Dmitry Vyukov wrote: > >> > On Fri, Dec

Re: fs, net: deadlock between bind/splice on af_unix

2017-01-26 Thread Cong Wang
On Thu, Jan 26, 2017 at 3:29 PM, Mateusz Guzik wrote: > On Tue, Jan 17, 2017 at 01:21:48PM -0800, Cong Wang wrote: >> On Mon, Jan 16, 2017 at 1:32 AM, Dmitry Vyukov wrote: >> > On Fri, Dec 9, 2016 at 7:41 AM, Al Viro wrote: >> >>

Re: fs, net: deadlock between bind/splice on af_unix

2017-01-26 Thread Mateusz Guzik
On Tue, Jan 17, 2017 at 01:21:48PM -0800, Cong Wang wrote: > On Mon, Jan 16, 2017 at 1:32 AM, Dmitry Vyukov wrote: > > On Fri, Dec 9, 2016 at 7:41 AM, Al Viro wrote: > >> On Thu, Dec 08, 2016 at 10:32:00PM -0800, Cong Wang wrote: > >> > >>> > Why do

Re: fs, net: deadlock between bind/splice on af_unix

2017-01-23 Thread Cong Wang
On Fri, Jan 20, 2017 at 2:52 PM, Dmitry Vyukov wrote: > > This works! I did not see the deadlock warning, nor any other related crashes. > > Tested-by: Dmitry Vyukov Thanks for verifying it. I will send it out formally soon.

Re: fs, net: deadlock between bind/splice on af_unix

2017-01-20 Thread Dmitry Vyukov
On Fri, Jan 20, 2017 at 5:57 AM, Cong Wang wrote: >> > Why do we do autobind there, anyway, and why is it conditional on >> > SOCK_PASSCRED? Note that e.g. for SOCK_STREAM we can bloody well get >> > to sending stuff without autobind ever done - just use

Re: fs, net: deadlock between bind/splice on af_unix

2017-01-19 Thread Cong Wang
On Wed, Jan 18, 2017 at 1:17 AM, Dmitry Vyukov wrote: > On Tue, Jan 17, 2017 at 10:21 PM, Cong Wang wrote: >> On Mon, Jan 16, 2017 at 1:32 AM, Dmitry Vyukov wrote: >>> On Fri, Dec 9, 2016 at 7:41 AM, Al Viro

Re: fs, net: deadlock between bind/splice on af_unix

2017-01-18 Thread Dmitry Vyukov
On Tue, Jan 17, 2017 at 10:21 PM, Cong Wang wrote: > On Mon, Jan 16, 2017 at 1:32 AM, Dmitry Vyukov wrote: >> On Fri, Dec 9, 2016 at 7:41 AM, Al Viro wrote: >>> On Thu, Dec 08, 2016 at 10:32:00PM -0800, Cong Wang wrote: >>>

Re: fs, net: deadlock between bind/splice on af_unix

2017-01-17 Thread Cong Wang
On Mon, Jan 16, 2017 at 1:32 AM, Dmitry Vyukov wrote: > On Fri, Dec 9, 2016 at 7:41 AM, Al Viro wrote: >> On Thu, Dec 08, 2016 at 10:32:00PM -0800, Cong Wang wrote: >> >>> > Why do we do autobind there, anyway, and why is it conditional on >>> >

Re: fs, net: deadlock between bind/splice on af_unix

2017-01-17 Thread Eric W. Biederman
Al Viro writes: > On Thu, Dec 08, 2016 at 10:32:00PM -0800, Cong Wang wrote: > >> > Why do we do autobind there, anyway, and why is it conditional on >> > SOCK_PASSCRED? Note that e.g. for SOCK_STREAM we can bloody well get >> > to sending stuff without autobind ever

Re: fs, net: deadlock between bind/splice on af_unix

2017-01-16 Thread Dmitry Vyukov
On Fri, Dec 9, 2016 at 7:41 AM, Al Viro wrote: > On Thu, Dec 08, 2016 at 10:32:00PM -0800, Cong Wang wrote: > >> > Why do we do autobind there, anyway, and why is it conditional on >> > SOCK_PASSCRED? Note that e.g. for SOCK_STREAM we can bloody well get >> > to sending

Re: fs, net: deadlock between bind/splice on af_unix

2016-12-08 Thread Al Viro
On Thu, Dec 08, 2016 at 10:32:00PM -0800, Cong Wang wrote: > > Why do we do autobind there, anyway, and why is it conditional on > > SOCK_PASSCRED? Note that e.g. for SOCK_STREAM we can bloody well get > > to sending stuff without autobind ever done - just use socketpair() > > to create that

Re: fs, net: deadlock between bind/splice on af_unix

2016-12-08 Thread Cong Wang
On Thu, Dec 8, 2016 at 5:32 PM, Al Viro wrote: > On Thu, Dec 08, 2016 at 04:08:27PM -0800, Cong Wang wrote: >> On Thu, Dec 8, 2016 at 8:30 AM, Dmitry Vyukov wrote: >> > Chain exists of: >> > Possible unsafe locking scenario: >> > >> >CPU0

Re: fs, net: deadlock between bind/splice on af_unix

2016-12-08 Thread Al Viro
On Thu, Dec 08, 2016 at 04:08:27PM -0800, Cong Wang wrote: > On Thu, Dec 8, 2016 at 8:30 AM, Dmitry Vyukov wrote: > > Chain exists of: > > Possible unsafe locking scenario: > > > >CPU0CPU1 > > > >

Re: fs, net: deadlock between bind/splice on af_unix

2016-12-08 Thread Cong Wang
On Thu, Dec 8, 2016 at 8:30 AM, Dmitry Vyukov wrote: > Chain exists of: > Possible unsafe locking scenario: > >CPU0CPU1 > > lock(sb_writers#5); >lock(>bindlock); >

Re: fs, net: deadlock between bind/splice on af_unix

2016-12-08 Thread Dmitry Vyukov
On Thu, Dec 8, 2016 at 3:47 PM, Dmitry Vyukov wrote: > Hello, > > I am getting the following deadlock reports while running syzkaller > fuzzer on 318c8932ddec5c1c26a4af0f3c053784841c598e (Dec 7). > > > [ INFO: possible circular locking dependency detected ] > 4.9.0-rc8+ #77

fs, net: deadlock between bind/splice on af_unix

2016-12-08 Thread Dmitry Vyukov
Hello, I am getting the following deadlock reports while running syzkaller fuzzer on 318c8932ddec5c1c26a4af0f3c053784841c598e (Dec 7). [ INFO: possible circular locking dependency detected ] 4.9.0-rc8+ #77 Not tainted --- syz-executor0/3155 is