Skip to content

Commit e62cb1c

Browse files
Ziyang Xuangregkh
authored andcommitted
netfilter: nfnetlink: fix potential dead lock in nfnetlink_rcv_msg()
[ Upstream commit 03832a3 ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 0bd2031 commit e62cb1c

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
@@ -290,6 +290,7 @@ static int nfnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
290290
nfnl_lock(subsys_id);
291291
if (nfnl_dereference_protected(subsys_id) != ss ||
292292
nfnetlink_find_client(type, ss) != nc) {
293+
nfnl_unlock(subsys_id);
293294
err = -EAGAIN;
294295
break;
295296
}

0 commit comments

Comments
 (0)