]> 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)
commit0315bebc6160c2ba15e916feaa2b7184ccbfb4c8
tree45041ede5c3dc94a1f0765a8dc8417d34fe98f0e
parent00c997d75f4f2608b7d86e5f2476acade3bd4fc3
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