Skip to content

Commit 619b174

Browse files
Florian Westphaldavem330
Florian Westphal
authored andcommitted
tipc: fix null deref crash in compat config path
msg.dst_sk needs to be set up with a valid socket because some callbacks later derive the netns from it. Fixes: 263ea09084d172d ("Revert "genl: Add genlmsg_new_unicast() for unicast message allocation") Reported-by: Jon Maloy <[email protected]> Bisected-by: Jon Maloy <[email protected]> Signed-off-by: Florian Westphal <[email protected]> Acked-by Jon Maloy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d25a012 commit 619b174

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/tipc/netlink_compat.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,7 @@ static int tipc_nl_compat_recv(struct sk_buff *skb, struct genl_info *info)
11051105
msg.req = nlmsg_data(req_nlh) + GENL_HDRLEN + TIPC_GENL_HDRLEN;
11061106
msg.cmd = req_userhdr->cmd;
11071107
msg.net = genl_info_net(info);
1108+
msg.dst_sk = skb->sk;
11081109

11091110
if ((msg.cmd & 0xC000) && (!netlink_net_capable(skb, CAP_NET_ADMIN))) {
11101111
msg.rep = tipc_get_err_tlv(TIPC_CFG_NOT_NET_ADMIN);

0 commit comments

Comments
 (0)