Skip to content

Commit 743117a

Browse files
YueHaibingPaolo Abeni
authored andcommitted
tipc: Fix potential OOB in tipc_link_proto_rcv()
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]>
1 parent 433c07a commit 743117a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/tipc/link.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2224,7 +2224,9 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb,
22242224
if (tipc_own_addr(l->net) > msg_prevnode(hdr))
22252225
l->net_plane = msg_net_plane(hdr);
22262226

2227-
skb_linearize(skb);
2227+
if (skb_linearize(skb))
2228+
goto exit;
2229+
22282230
hdr = buf_msg(skb);
22292231
data = msg_data(hdr);
22302232

0 commit comments

Comments
 (0)