From: liucheng (G) Date: Thu, 29 Aug 2019 13:47:48 +0000 (+0000) Subject: CVE-2019-14194/CVE-2019-14198: nfs: fix unbounded memcpy with a failed length check... X-Git-Tag: v2019.10-rc4~22^2~5 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=aa207cf3a6d68f39d64cd29057a4fb63943e9078;p=oweals%2Fu-boot.git CVE-2019-14194/CVE-2019-14198: nfs: fix unbounded memcpy with a failed length check at nfs_read_reply This patch adds a check to rpc_pkt.u.reply.data at nfs_read_reply. Signed-off-by: Cheng Liu Reported-by: Fermín Serna Acked-by: Joe Hershberger --- diff --git a/net/nfs.c b/net/nfs.c index b7cf3b3a18..11941fad1a 100644 --- a/net/nfs.c +++ b/net/nfs.c @@ -701,6 +701,9 @@ static int nfs_read_reply(uchar *pkt, unsigned len) &(rpc_pkt.u.reply.data[4 + nfsv3_data_offset]); } + if (((uchar *)&(rpc_pkt.u.reply.data[0]) - (uchar *)(&rpc_pkt) + rlen) > len) + return -9999; + if (store_block(data_ptr, nfs_offset, rlen)) return -9999;