]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: gre: correct calculation of max_headroom
authorHannes Frederic Sowa <hannes@stressinduktion.org>
Sun, 29 Sep 2013 03:40:50 +0000 (05:40 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Oct 2013 05:04:09 +0000 (22:04 -0700)
commit7069447660c0b12640400877e3f58c7b5e0bec51
tree071f33a1289ad20fda51b816d3df6703e37d1866
parente423a787b943fc533b0b0a4c73145d4b0c06a9f9
ipv6: gre: correct calculation of max_headroom

gre_hlen already accounts for sizeof(struct ipv6_hdr) + gre header,
so initialize max_headroom to zero. Otherwise the

if (encap_limit >= 0) {
max_headroom += 8;
mtu -= 8;
}

increments an uninitialized variable before max_headroom was reset.

Found with coverity: 728539

Cc: Dmitry Kozlov <xeb@mail.ru>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_gre.c