unix_bind_bsd(): unlink if we fail after successful mknod
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 19 Jun 2021 03:50:32 +0000 (03:50 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Jun 2021 19:28:49 +0000 (12:28 -0700)
commitc0c3b8d380a8f54c75786d41f6f9efbe761dac6c
tree4c1fd9679c28f8f8305af59caad691d6fe42bf86
parent56c1731b280dc71febf5df80fcac1923ea973ab8
unix_bind_bsd(): unlink if we fail after successful mknod

We can do that more or less safely, since the parent is
held locked all along.  Yes, somebody might observe the
object via dcache, only to have it disappear afterwards,
but there's really no good way to prevent that.  It won't
race with other bind(2) or attempts to move the sucker
elsewhere, or put something else in its place - locked
parent prevents that.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/unix/af_unix.c