[Feature][ZXW-265]merge P56U03 version
Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No
Change-Id: I873f6df64e2605a77b8b8bfec35b21e7f33c5444
diff --git a/ap/os/linux/linux-3.4.x/net/ipv4/igmp.c b/ap/os/linux/linux-3.4.x/net/ipv4/igmp.c
old mode 100644
new mode 100755
index 7824677..8abe6b0
--- a/ap/os/linux/linux-3.4.x/net/ipv4/igmp.c
+++ b/ap/os/linux/linux-3.4.x/net/ipv4/igmp.c
@@ -107,6 +107,7 @@
#define IP_MAX_MEMBERSHIPS 20
#define IP_MAX_MSF 10
+#define IP_MAX_MTU 0xFFFFU
#ifdef CONFIG_IP_MULTICAST
/* Parameter names and values are taken from igmp-v2-06 draft */
@@ -295,7 +296,7 @@
#define igmp_skb_size(skb) (*(unsigned int *)((skb)->cb))
-static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
+static struct sk_buff *igmpv3_newpack(struct net_device *dev, unsigned int size)
{
struct sk_buff *skb;
struct rtable *rt;
@@ -306,6 +307,9 @@
int hlen = LL_RESERVED_SPACE(dev);
int tlen = dev->needed_tailroom;
+ /* CVE-2023-42752 */
+ size = min(size, IP_MAX_MTU);
+
while (1) {
skb = alloc_skb(size + hlen + tlen,
GFP_ATOMIC | __GFP_NOWARN);