Showing error 1890

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: net/ipv6/addrconf.c
Line in file: 817
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

 787         * Purge or update corresponding prefix
 788         *
 789         * 1) we don't purge prefix here if address was not permanent.
 790         *    prefix is managed by its own lifetime.
 791         * 2) if there're no addresses, delete prefix.
 792         * 3) if there're still other permanent address(es),
 793         *    corresponding prefix is still permanent.
 794         * 4) otherwise, update prefix lifetime to the
 795         *    longest valid lifetime among the corresponding
 796         *    addresses on the device.
 797         *    Note: subsequent RA will update lifetime.
 798         *
 799         * --yoshfuji
 800         */
 801        if ((ifp->flags & IFA_F_PERMANENT) && onlink < 1) {
 802                struct in6_addr prefix;
 803                struct rt6_info *rt;
 804                struct net *net = dev_net(ifp->idev->dev);
 805                ipv6_addr_prefix(&prefix, &ifp->addr, ifp->prefix_len);
 806                rt = rt6_lookup(net, &prefix, NULL, ifp->idev->dev->ifindex, 1);
 807
 808                if (rt && addrconf_is_prefix_route(rt)) {
 809                        if (onlink == 0) {
 810                                ip6_del_rt(rt);
 811                                rt = NULL;
 812                        } else if (!(rt->rt6i_flags & RTF_EXPIRES)) {
 813                                rt->rt6i_expires = expires;
 814                                rt->rt6i_flags |= RTF_EXPIRES;
 815                        }
 816                }
 817                dst_release(&rt->u.dst);
 818        }
 819
 820        in6_ifa_put(ifp);
 821}
 822
 823#ifdef CONFIG_IPV6_PRIVACY
 824static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp, struct inet6_ifaddr *ift)
 825{
 826        struct inet6_dev *idev = ifp->idev;
 827        struct in6_addr addr, *tmpaddr;
Show full sources