]> git.baikalelectronics.ru Git - kernel.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)
committerJakub Kicinski <kuba@kernel.org>
Wed, 8 Jun 2022 17:56:43 +0000 (10:56 -0700)
commitf638a84afef3dfe10554c51820c16e39a278c915
tree45041ede5c3dc94a1f0765a8dc8417d34fe98f0e
parentf93431c86b631bbca5614c66f966bf3ddb3c2803
ipv6: Fix signed integer overflow in l2tp_ip6_sendmsg

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>
net/l2tp/l2tp_ip6.c