Showing error 1889

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


Source:

319
320        return 0;
321drop:
322        return -1;
323}
324
325static int ip_rcv_finish(struct sk_buff *skb)
326{
327        const struct iphdr *iph = ip_hdr(skb);
328        struct rtable *rt;
329
330        /*
331         *        Initialise the virtual path cache for the packet. It describes
332         *        how the packet travels inside Linux networking.
333         */
334        if (skb->dst == NULL) {
335                int err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos,
336                                         skb->dev);
337                if (unlikely(err)) {
338                        if (err == -EHOSTUNREACH)
339                                IP_INC_STATS_BH(dev_net(skb->dev),
340                                                IPSTATS_MIB_INADDRERRORS);
341                        else if (err == -ENETUNREACH)
342                                IP_INC_STATS_BH(dev_net(skb->dev),
343                                                IPSTATS_MIB_INNOROUTES);
344                        goto drop;
345                }
346        }
347
348#ifdef CONFIG_NET_CLS_ROUTE
349        if (unlikely(skb->dst->tclassid)) {
350                struct ip_rt_acct *st = per_cpu_ptr(ip_rt_acct, smp_processor_id());
351                u32 idx = skb->dst->tclassid;
352                st[idx&0xFF].o_packets++;
353                st[idx&0xFF].o_bytes+=skb->len;
354                st[(idx>>16)&0xFF].i_packets++;
355                st[(idx>>16)&0xFF].i_bytes+=skb->len;
356        }
357#endif
358
359        if (iph->ihl > 5 && ip_rcv_options(skb))
Show full sources