tipc: Fix potential OOB in tipc_link_proto_rcv()
authorYueHaibing <yuehaibing@huawei.com>
Sat, 3 Dec 2022 09:46:35 +0000 (17:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Dec 2022 10:24:35 +0000 (11:24 +0100)
commit62ae69ea7be897d75022999378477b2a94ee90b4
treebbc9a3f3a314e9f0af6ffc6f575a9e3fde181f62
parent179499e7a240b2ef590f05eb379c810c26bbc8a4
tipc: Fix potential OOB in tipc_link_proto_rcv()

[ Upstream commit 743117a997bbd4840e827295c07e59bcd7f7caa3 ]

Fix the potential risk of OOB if skb_linearize() fails in
tipc_link_proto_rcv().

Fixes: 5cbb28a4bf65 ("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>
net/tipc/link.c