]> Pileus Git - ~andy/linux/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)
commitb045d37bd68c20ca88123c2b363cac5e3dae815f
tree2a623d5d9a5c3e8a7465a069ce8664897eae53fe
parent4fe46b9a4d0b5eef96867e6d5134159e5a65d2a5
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: 7d442fab0a67 ("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