1From fe7288069d2e6659117049f7d27e261b550bb725 Mon Sep 17 00:00:00 2001 2From: "liucheng (G)" <liucheng32@huawei.com> 3Date: Thu, 29 Aug 2019 13:47:33 +0000 4Subject: [PATCH] CVE: net: fix unbounded memcpy of UDP packet 5MIME-Version: 1.0 6Content-Type: text/plain; charset=utf8 7Content-Transfer-Encoding: 8bit 8 9This patch adds a check to udp_len to fix unbounded memcpy for 10CVE-2019-14192, CVE-2019-14193 and CVE-2019-14199. 11 12Signed-off-by: Cheng Liu <liucheng32@huawei.com> 13Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> 14Reported-by: FermÃn Serna <fermin@semmle.com> 15Acked-by: Joe Hershberger <joe.hershberger@ni.com> 16--- 17 net/net.c | 3 +++ 18 1 file changed, 3 insertions(+) 19 20diff --git a/net/net.c b/net/net.c 21index 74a8a36..ded86e7 100644 22--- a/net/net.c 23+++ b/net/net.c 24@@ -1264,6 +1264,9 @@ void net_process_received_packet(uchar *in_packet, int len) 25 return; 26 } 27 28+ if (ntohs(ip->udp_len) < UDP_HDR_SIZE || ntohs(ip->udp_len) > ntohs(ip->ip_len)) 29+ return; 30+ 31 debug_cond(DEBUG_DEV_PKT, 32 "received UDP (to=%pI4, from=%pI4, len=%d)\n", 33 &dst_ip, &src_ip, len); 34-- 351.9.1 36 37