From: Florian Westphal Date: Wed, 24 Feb 2016 16:20:17 +0000 (+0100) Subject: tipc: fix null deref crash in compat config path X-Git-Tag: v5.15~13995^2~178 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=619b17452a388d6be69a7b28dc92310ea3f5aa65;p=platform%2Fkernel%2Flinux-starfive.git 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 Bisected-by: Jon Maloy Signed-off-by: Florian Westphal Acked-by Jon Maloy Signed-off-by: David S. Miller --- diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c index de66d8f..d7d050f 100644 --- a/net/tipc/netlink_compat.c +++ b/net/tipc/netlink_compat.c @@ -1105,6 +1105,7 @@ static int tipc_nl_compat_recv(struct sk_buff *skb, struct genl_info *info) msg.req = nlmsg_data(req_nlh) + GENL_HDRLEN + TIPC_GENL_HDRLEN; msg.cmd = req_userhdr->cmd; msg.net = genl_info_net(info); + msg.dst_sk = skb->sk; if ((msg.cmd & 0xC000) && (!netlink_net_capable(skb, CAP_NET_ADMIN))) { msg.rep = tipc_get_err_tlv(TIPC_CFG_NOT_NET_ADMIN);