mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
net/ip6_tunnel: Prevent perpetual tunnel growth
[ Upstream commit 21f4d45eba0b2dcae5dbc9e5e0ad08735c993f16 ]
Similarly to ipv4 tunnel, ipv6 version updates dev->needed_headroom, too.
While ipv4 tunnel headroom adjustment growth was limited in
commit 5ae1e9922bbd ("net: ip_tunnel: prevent perpetual headroom growth"),
ipv6 tunnel yet increases the headroom without any ceiling.
Reflect ipv4 tunnel headroom adjustment limit on ipv6 version.
Credits to Francesco Ruggeri, who was originally debugging this issue
and wrote local Arista-specific patch and a reproducer.
Fixes: 8eb30be035 ("ipv6: Create ip6_tnl_xmit")
Cc: Florian Westphal <[email protected]>
Cc: Francesco Ruggeri <[email protected]>
Signed-off-by: Dmitry Safonov <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
eb8be540b5
commit
566f8d5c8a
3 changed files with 16 additions and 16 deletions
|
|
@ -1201,8 +1201,7 @@ route_lookup:
|
|||
*/
|
||||
max_headroom = LL_RESERVED_SPACE(dst->dev) + sizeof(struct ipv6hdr)
|
||||
+ dst->header_len + t->hlen;
|
||||
if (max_headroom > READ_ONCE(dev->needed_headroom))
|
||||
WRITE_ONCE(dev->needed_headroom, max_headroom);
|
||||
ip_tunnel_adj_headroom(dev, max_headroom);
|
||||
|
||||
err = ip6_tnl_encap(skb, t, &proto, fl6);
|
||||
if (err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue