]> git.baikalelectronics.ru Git - kernel.git/commit
ip_tunnel: fix panic in ip_tunnel_xmit()
authorEric Dumazet <edumazet@google.com>
Mon, 3 Feb 2014 20:52:14 +0000 (12:52 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Feb 2014 21:01:48 +0000 (13:01 -0800)
commitf2af6d765b74b323c9f6174d1166d5be5f41a907
tree2a623d5d9a5c3e8a7465a069ce8664897eae53fe
parent7e93e574d976b54582588dd3f44ff95b12a975f4
ip_tunnel: fix panic in ip_tunnel_xmit()

Setting rt variable to NULL at the beginning of ip_tunnel_xmit()
missed possible use of this variable as a scratch value.

Also fixes a possible dst leak in tunnel_dst_check() :
If we had to call tunnel_dst_reset(), we forgot to
release the reference on dst.

Merges tunnel_dst_get()/tunnel_dst_check() into
a single tunnel_rtable_get() function for clarity.

Many thanks to Tommi for his report and tests.

Fixes: d8a5721b5545 ("ipv4: Cache dst in tunnels")
Reported-by: Tommi Rantala <tt.rantala@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Tested-by: Tommi Rantala <tt.rantala@gmail.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Maciej Żenczykowski <maze@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_tunnel.c