From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [bug report] ipv6: fix ip6_tnl_parse_tlv_enc_lim()
Date: Tue, 31 Jan 2017 11:12:56 +0000 [thread overview]
Message-ID: <20170131111256.GA31319@mwanda> (raw)
Hello Eric Dumazet,
The patch fbfa743a9d2a: "ipv6: fix ip6_tnl_parse_tlv_enc_lim()" from
Jan 23, 2017, leads to the following static checker warning:
net/ipv6/ip6_tunnel.c:444 ip6_tnl_parse_tlv_enc_lim()
warn: potential pointer math issue ('skb->data' is a 24 bit pointer)
net/ipv6/ip6_tunnel.c
437 while (1) {
438 struct ipv6_tlv_tnl_enc_lim *tel;
439
440 /* No more room for encapsulation limit */
441 if (i + sizeof(*tel) > optlen)
442 break;
443
444 tel = (struct ipv6_tlv_tnl_enc_lim *) skb->data + off + i;
This should be:
tel = (struct ipv6_tlv_tnl_enc_lim *)(skb->data + off + i);
Someone probably already reported this?
445 /* return index of option if found and valid */
446 if (tel->type = IPV6_TLV_TNL_ENCAP_LIMIT &&
447 tel->length = 1)
448 return i + off - nhoff;
449 /* else jump to next option */
450 if (tel->type)
451 i += tel->length + 2;
452 else
453 i++;
454 }
regards,
dan carpenter
next reply other threads:[~2017-01-31 11:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-31 11:12 Dan Carpenter [this message]
2017-01-31 14:22 ` [bug report] ipv6: fix ip6_tnl_parse_tlv_enc_lim() Eric Dumazet
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=20170131111256.GA31319@mwanda \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@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