Skip to content

Commit

Permalink
tipc: Fix potential OOB in tipc_link_proto_rcv()
Browse files Browse the repository at this point in the history
Fix the potential risk of OOB if skb_linearize() fails in
tipc_link_proto_rcv().

Fixes: 5cbb28a ("tipc: linearize arriving NAME_DISTR and LINK_PROTO buffers")
Signed-off-by: YueHaibing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
YueHaibing authored and Paolo Abeni committed Dec 6, 2022
1 parent 433c07a commit 743117a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/tipc/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -2224,7 +2224,9 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb,
if (tipc_own_addr(l->net) > msg_prevnode(hdr))
l->net_plane = msg_net_plane(hdr);

skb_linearize(skb);
if (skb_linearize(skb))
goto exit;

hdr = buf_msg(skb);
data = msg_data(hdr);

Expand Down

0 comments on commit 743117a

Please sign in to comment.