Message ID | 20190424173606.12451-1-dsahern@kernel.org |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
Series | [net-next] ipv6: Initialize fib6_result in bpf_ipv6_fib_lookup | expand |
From: David Ahern <dsahern@kernel.org> Date: Wed, 24 Apr 2019 10:36:06 -0700 > From: David Ahern <dsahern@gmail.com> > > fib6_result is not initialized in bpf_ipv6_fib_lookup and potentially > passses garbage to the fib lookup which triggers a KASAN warning: ... > Initialize fib6_result to 0. > > Fixes: b1d40991506aa ("ipv6: Rename fib6_multipath_select and pass fib6_result") > Signed-off-by: David Ahern <dsahern@gmail.com> Applied, thanks David.
diff --git a/net/core/filter.c b/net/core/filter.c index fa8fb0548217..9d28e7e8a4cb 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -4680,8 +4680,8 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, { struct in6_addr *src = (struct in6_addr *) params->ipv6_src; struct in6_addr *dst = (struct in6_addr *) params->ipv6_dst; + struct fib6_result res = {}; struct neighbour *neigh; - struct fib6_result res; struct net_device *dev; struct inet6_dev *idev; struct flowi6 fl6;