]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipv4: don't let PMTU updates increase route MTU
authorSabrina Dubroca <sd@queasysnail.net>
Tue, 9 Oct 2018 15:48:15 +0000 (17:48 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Oct 2018 05:44:46 +0000 (22:44 -0700)
commit345c70e52cde2b3396189d7f3404499a093dd26e
tree57dd5ec8a63d7a9df7cde67afa189b8d02abe83b
parent0f32fea353607f33d2d0ef11604e0a5ee51ec6ad
net: ipv4: don't let PMTU updates increase route MTU

When an MTU update with PMTU smaller than net.ipv4.route.min_pmtu is
received, we must clamp its value. However, we can receive a PMTU
exception with PMTU < old_mtu < ip_rt_min_pmtu, which would lead to an
increase in PMTU.

To fix this, take the smallest of the old MTU and ip_rt_min_pmtu.

Before this patch, in case of an update, the exception's MTU would
always change. Now, an exception can have only its lock flag updated,
but not the MTU, so we need to add a check on locking to the following
"is this exception getting updated, or close to expiring?" test.

Fixes: f4f42a6066e0 ("ipv4: lock mtu in fnhe when received PMTU < net.ipv4.route.min_pmtu")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/route.c