ipv6: fix out-of-bound access in ip6_parse_tlv()
stable inclusion from linux-4.19.198 commit 6c7a0c308b3ac149ab6e4a86c7b9bc9ffce6154e -------------------------------- [ Upstream commit 624085a3 ] First problem is that optlen is fetched without checking there is more than one byte to parse. Fix this by taking care of IPV6_TLV_PAD1 before fetching optlen (under appropriate sanity checks against len) Second problem is that IPV6_TLV_PADN checks of zero padding are performed before the check of remaining length. Fixes: 1da177e4 ("Linux-2.6.12-rc2") Fixes: c1412fce ("net/ipv6/exthdrs.c: Strict PadN option checking") Signed-off-by: NEric Dumazet <edumazet@google.com> Cc: Paolo Abeni <pabeni@redhat.com> Cc: Tom Herbert <tom@herbertland.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Showing
想要评论请 注册 或 登录