netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: xeb@mail.ru
Cc: netdev@vger.kernel.org
Subject: re: gre: Support GRE over IPv6
Date: Thu, 13 Sep 2012 19:01:05 +0300	[thread overview]
Message-ID: <20120913160105.GA29205@elgon.mountain> (raw)

Hello Dmitry Kozlov,

The patch c12b395a4664: "gre: Support GRE over IPv6" from Aug 10, 
2012, leads to the following warning:
net/ipv6/ip6_gre.c:1299 ip6gre_header_parse()
	 error: memcpy() 'haddr' too small (8 vs 16)

net/ipv6/ip6_gre.c
  1296  static int ip6gre_header_parse(const struct sk_buff *skb, unsigned char *haddr)
  1297  {
  1298          const struct ipv6hdr *ipv6h = (const struct ipv6hdr *)skb_mac_header(skb);
  1299          memcpy(haddr, &ipv6h->saddr, sizeof(struct in6_addr));
                       ^^^^^
Smatch thinks this buffer is only 8 characters sometimes.

  1300          return sizeof(struct in6_addr);
  1301  }

One call tree where this would happen would be the
(struct sockaddr_ll *)sll->sll_addr[] in packet_rcv().

-> packet_rcv()
   -> dev_parse_header()
      -> ip6gre_header_parse()

I don't know the code well enough to say if this is a bug or not.  Could
you take a look?

regards,
dan carpenter

             reply	other threads:[~2012-09-13 16:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-13 16:01 Dan Carpenter [this message]
2012-09-26 11:02 ` gre: Support GRE over IPv6 Dan Carpenter
2012-09-26 11:39   ` Eric Dumazet
2012-09-27 23:07     ` David Miller
     [not found] <20121002205219.7C3BD340556@ra.kernel.org>
2013-04-24 12:23 ` Geert Uytterhoeven
2013-04-24 15:14   ` 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=20120913160105.GA29205@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=xeb@mail.ru \
    /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).