mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
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 <liucheng32@huawei.com> Reported-by: Fermín Serna <fermin@semmle.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
741a8a08eb
commit
aa207cf3a6
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue