Commit ce559a0c authored by Al Viro's avatar Al Viro Committed by Zheng Zengkai
Browse files

unix_bind_bsd(): unlink if we fail after successful mknod

mainline inclusion
from mainline-v5.14-rc1
commit c0c3b8d3
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4OM1C
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c0c3b8d380a8f54c75786d41f6f9efbe761dac6c



--------------------------------

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>

Conflicts:
	net/unix/af_unix.c

Signed-off-by: default avatarBaisong Zhong <zhongbaisong@huawei.com>
Reviewed-by: default avatarYue Haibing <yuehaibing@huawei.com>
Reviewed-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent e73a033c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment