]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ipv6: Fix signed integer overflow in l2tp_ip6_sendmsg
authorWang Yufen <wangyufen@huawei.com>
Tue, 7 Jun 2022 12:00:28 +0000 (20:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 09:45:17 +0000 (11:45 +0200)
commit2cf73c7cb6125083408d77f43d0e84d86aed0000
tree24c560b65a18957222d1e0b03c74f2c2473d1e2c
parent1eb0afecfb9cd0f38424b82bd9aaa542310934ee
ipv6: Fix signed integer overflow in l2tp_ip6_sendmsg

[ Upstream commit f638a84afef3dfe10554c51820c16e39a278c915 ]

When len >= INT_MAX - transhdrlen, ulen = len + transhdrlen will be
overflow. To fix, we can follow what udpv6 does and subtract the
transhdrlen from the max.

Signed-off-by: Wang Yufen <wangyufen@huawei.com>
Link: https://lore.kernel.org/r/20220607120028.845916-2-wangyufen@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/l2tp/l2tp_ip6.c