summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/u-boot/files/0007-CVE-2019-14194-14198.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-bsp/u-boot/files/0007-CVE-2019-14194-14198.patch')
-rw-r--r--meta/recipes-bsp/u-boot/files/0007-CVE-2019-14194-14198.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-bsp/u-boot/files/0007-CVE-2019-14194-14198.patch b/meta/recipes-bsp/u-boot/files/0007-CVE-2019-14194-14198.patch
new file mode 100644
index 0000000000..b3e3b72ebf
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/files/0007-CVE-2019-14194-14198.patch
@@ -0,0 +1,42 @@
1From fb6dc193bf2685b7574b218f7ca558aa54659e11 Mon Sep 17 00:00:00 2001
2From: "liucheng (G)" <liucheng32@huawei.com>
3Date: Thu, 29 Aug 2019 13:47:48 +0000
4Subject: [PATCH 7/9] CVE-2019-14194/CVE-2019-14198: nfs: fix unbounded memcpy
5 with a failed length check at nfs_read_reply
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10This patch adds a check to rpc_pkt.u.reply.data at nfs_read_reply.
11
12Signed-off-by: Cheng Liu <liucheng32@huawei.com>
13Reported-by: Fermín Serna <fermin@semmle.com>
14Acked-by: Joe Hershberger <joe.hershberger@ni.com>
15
16Upstream-Status: Backport[http://git.denx.de/?p=u-boot.git;a=commit;
17 h=aa207cf3a6d68f39d64cd29057a4fb63943e9078]
18
19CVE: CVE-2019-14194 and CVE-2019-14198
20
21Signed-off-by: Meng Li <Meng.Li@windriver.com>
22---
23 net/nfs.c | 3 +++
24 1 file changed, 3 insertions(+)
25
26diff --git a/net/nfs.c b/net/nfs.c
27index b7cf3b3a18..11941fad1a 100644
28--- a/net/nfs.c
29+++ b/net/nfs.c
30@@ -701,6 +701,9 @@ static int nfs_read_reply(uchar *pkt, unsigned len)
31 &(rpc_pkt.u.reply.data[4 + nfsv3_data_offset]);
32 }
33
34+ if (((uchar *)&(rpc_pkt.u.reply.data[0]) - (uchar *)(&rpc_pkt) + rlen) > len)
35+ return -9999;
36+
37 if (store_block(data_ptr, nfs_offset, rlen))
38 return -9999;
39
40--
412.17.1
42