diff options
Diffstat (limited to 'meta/recipes-bsp/u-boot/files/0008-CVE-2019-14195.patch')
-rw-r--r-- | meta/recipes-bsp/u-boot/files/0008-CVE-2019-14195.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-bsp/u-boot/files/0008-CVE-2019-14195.patch b/meta/recipes-bsp/u-boot/files/0008-CVE-2019-14195.patch new file mode 100644 index 0000000000..bf9fb0ef52 --- /dev/null +++ b/meta/recipes-bsp/u-boot/files/0008-CVE-2019-14195.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 2236973b8a173ff54ae1ebf8ec2300928e69bd1b Mon Sep 17 00:00:00 2001 | ||
2 | From: "liucheng (G)" <liucheng32@huawei.com> | ||
3 | Date: Thu, 29 Aug 2019 13:47:54 +0000 | ||
4 | Subject: [PATCH 8/9] CVE-2019-14195: nfs: fix unbounded memcpy with | ||
5 | unvalidated length at nfs_readlink_reply | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | This patch adds a check to rpc_pkt.u.reply.data at nfs_readlink_reply. | ||
11 | |||
12 | Signed-off-by: Cheng Liu <liucheng32@huawei.com> | ||
13 | Reported-by: FermÃn Serna <fermin@semmle.com> | ||
14 | Acked-by: Joe Hershberger <joe.hershberger@ni.com> | ||
15 | |||
16 | Upstream-Status: Backport[http://git.denx.de/?p=u-boot.git;a=commit; | ||
17 | h=cf3a4f1e86ecdd24f87b615051b49d8e1968c230] | ||
18 | |||
19 | CVE: CVE-2019-14195 | ||
20 | |||
21 | Signed-off-by: Meng Li <Meng.Li@windriver.com> | ||
22 | --- | ||
23 | net/nfs.c | 3 +++ | ||
24 | 1 file changed, 3 insertions(+) | ||
25 | |||
26 | diff --git a/net/nfs.c b/net/nfs.c | ||
27 | index 11941fad1a..915acd95cf 100644 | ||
28 | --- a/net/nfs.c | ||
29 | +++ b/net/nfs.c | ||
30 | @@ -634,6 +634,9 @@ static int nfs_readlink_reply(uchar *pkt, unsigned len) | ||
31 | /* new path length */ | ||
32 | rlen = ntohl(rpc_pkt.u.reply.data[1 + nfsv3_data_offset]); | ||
33 | |||
34 | + if (((uchar *)&(rpc_pkt.u.reply.data[0]) - (uchar *)(&rpc_pkt) + rlen) > len) | ||
35 | + return -NFS_RPC_DROP; | ||
36 | + | ||
37 | if (*((char *)&(rpc_pkt.u.reply.data[2 + nfsv3_data_offset])) != '/') { | ||
38 | int pathlen; | ||
39 | |||
40 | -- | ||
41 | 2.17.1 | ||
42 | |||