Unverified Commit 600051b6 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!8850 ipv6: fib6_rules: avoid possible NULL dereference in fib6_rule_action()

parents 0a443047 bce7c35e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -232,8 +232,12 @@ static int __fib6_rule_action(struct fib_rule *rule, struct flowi *flp,
	rt = pol_lookup_func(lookup,
			     net, table, flp6, arg->lookup_data, flags);
	if (rt != net->ipv6.ip6_null_entry) {
		struct inet6_dev *idev = ip6_dst_idev(&rt->dst);

		if (!idev)
			goto again;
		err = fib6_rule_saddr(net, rule, flags, flp6,
				      ip6_dst_idev(&rt->dst)->dev);
				      idev->dev);

		if (err == -EAGAIN)
			goto again;