netfilter: nfnetlink: fix potential dead lock in nfnetlink_rcv_msg()
When type is NFNL_CB_MUTEX and -EAGAIN error occur in nfnetlink_rcv_msg(),
it does not execute nfnl_unlock(). That would trigger potential dead lock.
Fixes: 50f2db9e36
("netfilter: nfnetlink: consolidate callback types")
Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
This commit is contained in:
parent
ce9e57feee
commit
03832a32bf
@ -294,6 +294,7 @@ replay:
|
|||||||
nfnl_lock(subsys_id);
|
nfnl_lock(subsys_id);
|
||||||
if (nfnl_dereference_protected(subsys_id) != ss ||
|
if (nfnl_dereference_protected(subsys_id) != ss ||
|
||||||
nfnetlink_find_client(type, ss) != nc) {
|
nfnetlink_find_client(type, ss) != nc) {
|
||||||
|
nfnl_unlock(subsys_id);
|
||||||
err = -EAGAIN;
|
err = -EAGAIN;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user