Skip to content

Commit 03832a3

Browse files
Ziyang XuanFlorian Westphal
Ziyang Xuan
authored and
Florian Westphal
committed
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: 50f2db9 ("netfilter: nfnetlink: consolidate callback types") Signed-off-by: Ziyang Xuan <[email protected]> Signed-off-by: Florian Westphal <[email protected]>
1 parent ce9e57f commit 03832a3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/netfilter/nfnetlink.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ static int nfnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
294294
nfnl_lock(subsys_id);
295295
if (nfnl_dereference_protected(subsys_id) != ss ||
296296
nfnetlink_find_client(type, ss) != nc) {
297+
nfnl_unlock(subsys_id);
297298
err = -EAGAIN;
298299
break;
299300
}

0 commit comments

Comments
 (0)