]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: do not leave garbage in rt->fib6_metrics
authorEric Dumazet <edumazet@google.com>
Fri, 5 Oct 2018 16:17:50 +0000 (09:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Oct 2018 18:57:11 +0000 (11:57 -0700)
commit7e1203c2c64af8b906be6c7ffeea5e31ade3554b
tree9b8049c49b143525c3e511c3b9125dd829a4f801
parenteac7f4271ef6904329279fe1202bb57b3f95e1f7
ipv6: do not leave garbage in rt->fib6_metrics

In case ip_fib_metrics_init() returns an error, we better
rewrite rt->fib6_metrics with &dst_default_metrics so that
we do not crash later in ip_fib_metrics_put()

Fixes: 61a7e8dba136 ("net: common metrics init helper for FIB entries")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c