mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 13:37:36 +02:00
tipc: Fix potential OOB in tipc_link_proto_rcv()
[ Upstream commit743117a997] Fix the potential risk of OOB if skb_linearize() fails in tipc_link_proto_rcv(). Fixes:5cbb28a4bf("tipc: linearize arriving NAME_DISTR and LINK_PROTO buffers") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20221203094635.29024-1-yuehaibing@huawei.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
93aaa4bb72
commit
36e248269a
|
|
@ -2188,7 +2188,9 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb,
|
||||||
if (tipc_own_addr(l->net) > msg_prevnode(hdr))
|
if (tipc_own_addr(l->net) > msg_prevnode(hdr))
|
||||||
l->net_plane = msg_net_plane(hdr);
|
l->net_plane = msg_net_plane(hdr);
|
||||||
|
|
||||||
skb_linearize(skb);
|
if (skb_linearize(skb))
|
||||||
|
goto exit;
|
||||||
|
|
||||||
hdr = buf_msg(skb);
|
hdr = buf_msg(skb);
|
||||||
data = msg_data(hdr);
|
data = msg_data(hdr);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user