netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: re: ipv4: Perform peer validation on cached route lookup.
Date: Mon, 5 Dec 2011 16:27:14 +0300	[thread overview]
Message-ID: <20111205132714.GA27452@elgon.mountain> (raw)

Hello David S. Miller,

This is a semi-automatic email about new static checker warnings.

The patch efbc368dcc64: "ipv4: Perform peer validation on cached 
route lookup." from Dec 1, 2011, leads to the following Smatch 
complaint:

net/ipv4/route.c +2369 ip_route_input_common()
	 error: we previously assumed 'rth' could be null (see line 2378)

net/ipv4/route.c
  2368		for (rth = rcu_dereference(rt_hash_table[hash].chain); rth;
  2369		     rth = rcu_dereference(rth->dst.rt_next)) {
                                           ^^^^^^^^^^^^^^^^
The dereference here will oops

  2370			if ((((__force u32)rth->rt_key_dst ^ (__force u32)daddr) |
  2371			     ((__force u32)rth->rt_key_src ^ (__force u32)saddr) |
  2372			     (rth->rt_route_iif ^ iif) |
  2373			     (rth->rt_key_tos ^ tos)) == 0 &&
  2374			    rth->rt_mark == skb->mark &&
  2375			    net_eq(dev_net(rth->dst.dev), net) &&
  2376			    !rt_is_expired(rth)) {
  2377				rth = ipv4_validate_peer(rth);
  2378				if (!rth)
  2379					continue;

if we hit this new continue statement.

  2380				if (noref) {

regards,
dan carpenter

             reply	other threads:[~2011-12-05 13:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-05 13:27 Dan Carpenter [this message]
2011-12-05 13:31 ` ipv4: Perform peer validation on cached route lookup Dan Carpenter
2011-12-05 18:22   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111205132714.GA27452@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).