summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2022-11-19 15:28:32 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-12-02 17:41:06 +0100
commit46d450067fc0fc0573ce05f7dce34164b4800af1 (patch)
tree0e93e92b305544f9ff6a3b1269b61ea5bfccff7b /net
parent33fb115a76ae6683e34f76f7e07f6f0734b2525f (diff)
downloadlinux-46d450067fc0fc0573ce05f7dce34164b4800af1.tar.gz
linux-46d450067fc0fc0573ce05f7dce34164b4800af1.tar.bz2
linux-46d450067fc0fc0573ce05f7dce34164b4800af1.zip
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')
-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 e8630707901e..e8dcdf267c0c 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -211,7 +211,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)