Revision 7892032cfe67f4bde6fc2ee967e45a8fbaf33756 authored by Eric Dumazet on 05 February 2017, 07:18:55 UTC, committed by David S. Miller on 05 February 2017, 22:23:04 UTC
Andrey Konovalov reported out of bound accesses in ip6gre_err()

If GRE flags contains GRE_KEY, the following expression
*(((__be32 *)p) + (grehlen / 4) - 1)

accesses data ~40 bytes after the expected point, since
grehlen includes the size of IPv6 headers.

Let's use a "struct gre_base_hdr *greh" pointer to make this
code more readable.

p[1] becomes greh->protocol.
grhlen is the GRE header length.

Fixes: c12b395a4664 ("gre: Support GRE over IPv6")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent d71b789
History
File Mode Size
.gitignore -rw-r--r-- 12 bytes
Makefile -rw-r--r-- 288 bytes
hid-example.c -rw-r--r-- 3.9 KB

back to top