summaryrefslogtreecommitdiff
path: root/net/tipc
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2022-11-19 10:28:32 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-12-08 13:22:58 +0300
commit23ba1997ebc0d2183fc4e87f8038fa3457e0106e (patch)
tree6d297e4b5c6c14792a25c3c17c4c946777f9c4e6 /net/tipc
parent59f9aad22fd743572bdafa37d3e1dd5dc5658e26 (diff)
downloadlinux-23ba1997ebc0d2183fc4e87f8038fa3457e0106e.tar.xz
tipc: check skb_linearize() return value in tipc_disc_rcv()
[ Upstream commit cd0f6421162201e4b22ce757a1966729323185eb ] If skb_linearize() fails in tipc_disc_rcv(), we need to free the skb instead of handle it. Fixes: 25b0b9c4e835 ("tipc: handle collisions of 32-bit node address hash values") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Jon Maloy <jmaloy@redhat.com> Link: https://lore.kernel.org/r/20221119072832.7896-1-yuehaibing@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/discover.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index 0006c9f87199..0436c8f2967d 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -208,7 +208,10 @@ void tipc_disc_rcv(struct net *net, struct sk_buff *skb,
u32 self;
int err;
- skb_linearize(skb);
+ if (skb_linearize(skb)) {
+ kfree_skb(skb);
+ return;
+ }
hdr = buf_msg(skb);
if (caps & TIPC_NODE_ID128)