aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorYueHaibing <[email protected]>2022-11-19 07:28:32 +0000
committerJakub Kicinski <[email protected]>2022-11-22 04:50:24 +0000
commitcd0f6421162201e4b22ce757a1966729323185eb (patch)
treeda89b5d2b4c2a53621e6eae451b5e7a749173cea /net/tipc
parentMerge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/n... (diff)
downloadkernel-cd0f6421162201e4b22ce757a1966729323185eb.tar.gz
kernel-cd0f6421162201e4b22ce757a1966729323185eb.zip
tipc: check skb_linearize() return value in tipc_disc_rcv()
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 <[email protected]> Acked-by: Jon Maloy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
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 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)