]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: fix another slab-out-of-bounds in fib6_nh_flush_exceptions
authorPaolo Abeni <pabeni@redhat.com>
Tue, 20 Jul 2021 13:08:40 +0000 (15:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jul 2021 11:30:57 +0000 (13:30 +0200)
commit2ab6e9a34bdace748ce61f5b145be0faa574da7d
treed0a9018da61d17395b5c18dc9838b69ce4f806b9
parent0f11b143226ed442d870abfc9790e1c2e15e9eb8
ipv6: fix another slab-out-of-bounds in fib6_nh_flush_exceptions

[ Upstream commit 8fb4792f091e608a0a1d353dfdf07ef55a719db5 ]

While running the self-tests on a KASAN enabled kernel, I observed a
slab-out-of-bounds splat very similar to the one reported in
commit 821bbf79fe46 ("ipv6: Fix KASAN: slab-out-of-bounds Read in
 fib6_nh_flush_exceptions").

We additionally need to take care of fib6_metrics initialization
failure when the caller provides an nh.

The fix is similar, explicitly free the route instead of calling
fib6_info_release on a half-initialized object.

Fixes: fe5a5e47e048e ("ipv6: Plumb support for nexthop object in a fib6_info")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv6/route.c