Thread (20 messages) 20 messages, 4 authors, 2017-02-10

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

From: Al Viro <viro@ZenIV.linux.org.uk>
Date: 2016-12-09 06:41:44
Also in: linux-fsdevel, lkml

On Thu, Dec 08, 2016 at 10:32:00PM -0800, Cong Wang wrote:
quoted
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 sucker and we won't be going through the connect()
at all.
In the case Dmitry reported, unix_dgram_sendmsg() calls unix_autobind(),
not SOCK_STREAM.
Yes, I've noticed.  What I'm asking is what in there needs autobind triggered
on sendmsg and why doesn't the same need affect the SOCK_STREAM case?
I guess some lock, perhaps the u->bindlock could be dropped before
acquiring the next one (sb_writer), but I need to double check.
Bad idea, IMO - do you *want* autobind being able to come through while
bind(2) is busy with mknod?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help