]> 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)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Jul 2021 14:25:25 +0000 (07:25 -0700)
commit9b095a6a32ead808193bc93d63de3a73f29e79da
treedef872490d7230487120be864e57d149066e086f
parentdc8262fd8124c2ab588b9f64fdf72532d0a48294
ipv6: fix another slab-out-of-bounds in fib6_nh_flush_exceptions

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 30cfc29c4877 ("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>
net/ipv6/route.c