diff options
author | Eric Dumazet <edumazet@google.com> | 2017-08-16 11:09:12 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-16 16:28:47 -0700 |
commit | c780a049f9bf442314335372c9abc4548bfe3e44 (patch) | |
tree | 9bfe8c76f75ea6d1dbc52efa95ff294d80d58c8a /net/ipv4/route.c | |
parent | 81fbfe8adaf38d4f5a98c19bebfd41c5d6acaee8 (diff) | |
download | linux-stable-c780a049f9bf442314335372c9abc4548bfe3e44.tar.gz linux-stable-c780a049f9bf442314335372c9abc4548bfe3e44.tar.bz2 linux-stable-c780a049f9bf442314335372c9abc4548bfe3e44.zip |
ipv4: better IP_MAX_MTU enforcement
While working on yet another syzkaller report, I found
that our IP_MAX_MTU enforcements were not properly done.
gcc seems to reload dev->mtu for min(dev->mtu, IP_MAX_MTU), and
final result can be bigger than IP_MAX_MTU :/
This is a problem because device mtu can be changed on other cpus or
threads.
While this patch does not fix the issue I am working on, it is
probably worth addressing it.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 7effa62beed3..fe877a4a72b1 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1267,7 +1267,7 @@ static unsigned int ipv4_mtu(const struct dst_entry *dst) if (mtu) return mtu; - mtu = dst->dev->mtu; + mtu = READ_ONCE(dst->dev->mtu); if (unlikely(dst_metric_locked(dst, RTAX_MTU))) { if (rt->rt_uses_gateway && mtu > 576) |