]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/smc: check iparea_offset and ipv6_prefixes_cnt when receiving proposal msg
authorGuangguan Wang <guangguan.wang@linux.alibaba.com>
Wed, 11 Dec 2024 09:21:18 +0000 (17:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2025 12:24:52 +0000 (13:24 +0100)
commit846bada23bfcdeb83621b045ed85dc06c7833ff0
treed00e1e86e33b7875c57c3a4c03697592c9268c25
parente18830b7c498d85b268d9e94a938f6542ff4ab49
net/smc: check iparea_offset and ipv6_prefixes_cnt when receiving proposal msg

[ Upstream commit a29e220d3c8edbf0e1beb0f028878a4a85966556 ]

When receiving proposal msg in server, the field iparea_offset
and the field ipv6_prefixes_cnt in proposal msg are from the
remote client and can not be fully trusted. Especially the
field iparea_offset, once exceed the max value, there has the
chance to access wrong address, and crash may happen.

This patch checks iparea_offset and ipv6_prefixes_cnt before using them.

Fixes: e7b7a64a8493 ("smc: support variable CLC proposal messages")
Signed-off-by: Guangguan Wang <guangguan.wang@linux.alibaba.com>
Reviewed-by: Wen Gu <guwen@linux.alibaba.com>
Reviewed-by: D. Wythe <alibuda@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/smc/af_smc.c
net/smc/smc_clc.c
net/smc/smc_clc.h