From: Dan Carpenter <dan.carpenter@oracle.com>
To: Hans Schillstrom <hans.schillstrom@ericsson.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
Patrick McHardy <kaber@trash.net>,
"David S. Miller" <davem@davemloft.net>,
"netfilter-devel@vger.kernel.org"
<netfilter-devel@vger.kernel.org>,
"netfilter@vger.kernel.org" <netfilter@vger.kernel.org>,
"coreteam@netfilter.org" <coreteam@netfilter.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>
Subject: Re: [patch] netfilter: potential NULL dereference in get_inner_hdr()
Date: Mon, 14 May 2012 11:39:12 +0300 [thread overview]
Message-ID: <20120514083912.GB16999@mwanda> (raw)
In-Reply-To: <201205140936.56960.hans.schillstrom@ericsson.com>
On Mon, May 14, 2012 at 09:36:55AM +0200, Hans Schillstrom wrote:
> On Saturday 12 May 2012 13:00:03 Dan Carpenter wrote:
> > There is a typo in the error checking and "&&" was used instead of "||".
> > If skb_header_pointer() returns NULL then it leads to a NULL
> > dereference.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Ack-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
>
> > ---
> > Btw, this is new code and Sparse complains about endian bugs.
>
> Can you give me some hints here, arch , compiler version etc.
> I guess it was input to hmark_addr_mask() that complains ?
>
Yes. That was one of the warnings.
http://lwn.net/Articles/205624/
net/netfilter/xt_HMARK.c:87:35: warning: incorrect type in assignment (different base types)
net/netfilter/xt_HMARK.c:87:35: expected unsigned short [unsigned] [usertype] src
net/netfilter/xt_HMARK.c:87:35: got restricted __be16 [usertype] all
net/netfilter/xt_HMARK.c:88:35: warning: incorrect type in assignment (different base types)
net/netfilter/xt_HMARK.c:88:35: expected unsigned short [unsigned] [usertype] dst
net/netfilter/xt_HMARK.c:88:35: got restricted __be16 [usertype] all
net/netfilter/xt_HMARK.c:181:35: warning: incorrect type in argument 1 (different base types)
net/netfilter/xt_HMARK.c:181:35: expected unsigned int const [usertype] *addr32
net/netfilter/xt_HMARK.c:181:35: got restricted __be32 *<noident>
net/netfilter/xt_HMARK.c:182:35: warning: incorrect type in argument 1 (different base types)
net/netfilter/xt_HMARK.c:182:35: expected unsigned int const [usertype] *addr32
net/netfilter/xt_HMARK.c:182:35: got restricted __be32 *<noident>
net/netfilter/xt_HMARK.c:261:16: warning: invalid assignment: &=
net/netfilter/xt_HMARK.c:261:16: left side has type unsigned int
net/netfilter/xt_HMARK.c:261:16: right side has type restricted __be32
net/netfilter/xt_HMARK.c:262:16: warning: invalid assignment: &=
net/netfilter/xt_HMARK.c:262:16: left side has type unsigned int
net/netfilter/xt_HMARK.c:262:16: right side has type restricted __be32
regards,
dan carpenter
next prev parent reply other threads:[~2012-05-14 8:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-12 11:00 [patch] netfilter: potential NULL dereference in get_inner_hdr() Dan Carpenter
2012-05-14 7:36 ` Hans Schillstrom
2012-05-14 7:38 ` David Miller
2012-05-14 7:53 ` Eric Dumazet
2012-05-14 8:00 ` Hans Schillstrom
2012-05-14 8:22 ` Pablo Neira Ayuso
2012-05-14 8:39 ` Dan Carpenter [this message]
2012-05-14 8:24 ` Pablo Neira Ayuso
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=20120514083912.GB16999@mwanda \
--to=dan.carpenter@oracle.com \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=hans.schillstrom@ericsson.com \
--cc=kaber@trash.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=netfilter@vger.kernel.org \
--cc=pablo@netfilter.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).