Eric Dumazet 3138192865 igmp: limit igmpv3_newpack() packet size to IP_MAX_MTU
commit c3b704d4a4a265660e665df51b129e8425216ed1 upstream.

This is a follow up of commit 915d975b2ffa ("net: deal with integer
overflows in kmalloc_reserve()") based on David Laight feedback.

Back in 2010, I failed to realize malicious users could set dev->mtu
to arbitrary values. This mtu has been since limited to 0x7fffffff but
regardless of how big dev->mtu is, it makes no sense for igmpv3_newpack()
to allocate more than IP_MAX_MTU and risk various skb fields overflows.

Fixes: 57e1ab6eaddc ("igmp: refine skb allocations")
Link: https://lore.kernel.org/netdev/d273628df80f45428e739274ab9ecb72@AcuMS.aculab.com/
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: David Laight <David.Laight@ACULAB.COM>
Cc: Kyle Zeng <zengyhkyle@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-13 09:53:49 +02:00
..
2023-05-31 13:06:57 +02:00
2021-05-17 15:29:35 -07:00
2023-03-31 21:37:06 -07:00
2023-02-01 20:54:27 -08:00
2023-04-13 16:43:38 -07:00
2023-05-24 08:22:06 +01:00
2023-01-26 10:52:18 +01:00
2021-05-17 15:29:35 -07:00
2022-09-20 10:21:49 -07:00
2022-12-20 03:13:45 +01:00
2021-05-17 15:29:35 -07:00
2022-11-16 09:43:35 +00:00