]> git.itanic.dy.fi Git - linux-stable/commit
ipv6: Fix out-of-bounds access in ipv6_find_tlv()
authorGavrilov Ilia <Ilia.Gavrilov@infotecs.ru>
Tue, 23 May 2023 08:29:44 +0000 (08:29 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 11:42:14 +0000 (12:42 +0100)
commit04bf69e3de435d793a203aacc4b774f8f9f2baeb
treef7e314ca3fe270f63eb5a5addb6e321b31a04a73
parenta40aa36a696c8c81050619e8daf50a2c60f5f503
ipv6: Fix out-of-bounds access in ipv6_find_tlv()

commit 878ecb0897f4737a4c9401f3523fd49589025671 upstream.

optlen is fetched without checking whether there is more than one byte to parse.
It can lead to out-of-bounds access.

Found by InfoTeCS on behalf of Linux Verification Center
(linuxtesting.org) with SVACE.

Fixes: c61a40432509 ("[IPV6]: Find option offset by type.")
Signed-off-by: Gavrilov Ilia <Ilia.Gavrilov@infotecs.ru>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv6/exthdrs_core.c