diff options
author | Ziyang Xuan <william.xuanziyang@huawei.com> | 2022-11-03 09:12:02 +0800 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2022-11-08 23:16:13 +0100 |
commit | 03832a32bf8ff0a8305d94ddd3979835a807248f (patch) | |
tree | ecad606f2999f189c3f00c6bf9a2ad74ddae999e /net | |
parent | ce9e57feeed81d17d5e80ed86f516ff0d39c3867 (diff) |
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: 50f2db9e368f ("netfilter: nfnetlink: consolidate callback types")
Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/nfnetlink.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index 9c44518cb70f..6d18fb346868 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c @@ -294,6 +294,7 @@ replay: nfnl_lock(subsys_id); if (nfnl_dereference_protected(subsys_id) != ss || nfnetlink_find_client(type, ss) != nc) { + nfnl_unlock(subsys_id); err = -EAGAIN; break; } |