[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20191207.115543.1000946398725521110.davem@davemloft.net>
Date: Sat, 07 Dec 2019 11:55:43 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: edumazet@...gle.com
Cc: netdev@...r.kernel.org, eric.dumazet@...il.com,
syzkaller@...glegroups.com
Subject: Re: [PATCH net] inet: protect against too small mtu values.
From: Eric Dumazet <edumazet@...gle.com>
Date: Thu, 5 Dec 2019 20:43:46 -0800
> syzbot was once again able to crash a host by setting a very small mtu
> on loopback device.
>
> Let's make inetdev_valid_mtu() available in include/net/ip.h,
> and use it in ip_setup_cork(), so that we protect both ip_append_page()
> and __ip_append_data()
>
> Also add a READ_ONCE() when the device mtu is read.
>
> Pairs this lockless read with one WRITE_ONCE() in __dev_set_mtu(),
> even if other code paths might write over this field.
>
> Add a big comment in include/linux/netdevice.h about dev->mtu
> needing READ_ONCE()/WRITE_ONCE() annotations.
>
> Hopefully we will add the missing ones in followup patches.
...
> Fixes: 1470ddf7f8ce ("inet: Remove explicit write references to sk/inet in ip_append_data")
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Reported-by: syzbot <syzkaller@...glegroups.com>
Applied and queued up for -stable, thanks.
Powered by blists - more mailing lists