netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: eric@inl.fr
Cc: netfilter-devel@vger.kernel.org
Subject: re: netfilter: nfnetlink_log: send complete hardware header
Date: Thu, 22 Jul 2010 13:50:53 +0200	[thread overview]
Message-ID: <20100722115053.GF17585@bicker> (raw)

Hi,

Smatch complains abbout 72961ecf84d67d6 "netfilter: nfnetlink_log: send
complete hardware header" which is net-next.
    
   462          if (indev && skb->dev) {
                             ^^^^^^^^
	skb->dev can be NULL here.

   463                  struct nfulnl_msg_packet_hw phw;
   464                  int len = dev_parse_header(skb, phw.hw_addr);
   465                  if (len > 0) {
   466                          phw.hw_addrlen = htons(len);
   467                          NLA_PUT(inst->skb, NFULA_HWADDR, sizeof(phw), &phw);
   468                  }
   469          }
   470  
   471          if (indev && skb_mac_header_was_set(skb)) {
   472                  NLA_PUT_BE16(inst->skb, NFULA_HWTYPE, htons(skb->dev->type));
                                                                    ^^^^^^^^
	It's dereferenced here.

   473                  NLA_PUT_BE16(inst->skb, NFULA_HWLEN,
   474                               htons(skb->dev->hard_header_len));

I'm not sure how you want to deal with this.

regards,
dan carpenter

             reply	other threads:[~2010-07-22 11:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22 11:50 Dan Carpenter [this message]
2010-07-22 12:09 ` [PATCH] netfilter: nfnetlink_log: Fix potential problem if skb->dev is null Eric Leblond

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=20100722115053.GF17585@bicker \
    --to=error27@gmail.com \
    --cc=eric@inl.fr \
    --cc=netfilter-devel@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).