File 0019-CVE-nfs-fix-stack-based-buffer-over.patch of Package u-boot-rock960-rk3399
36
1
From f185ad7069f86e90af5fe0a52b698c6e7ce954f1 Mon Sep 17 00:00:00 2001
2
From: "liucheng (G)" <liucheng32@huawei.com>
3
Date: Thu, 29 Aug 2019 13:47:40 +0000
4
Subject: [PATCH] CVE: nfs: fix stack-based buffer overflow in some nfs_handler
5
reply helper functions
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 nfs_handler to fix buffer overflow for CVE-2019-14197,
11
CVE-2019-14200, CVE-2019-14201, CVE-2019-14202, CVE-2019-14203 and CVE-2019-14204.
12
13
Signed-off-by: Cheng Liu <liucheng32@huawei.com>
14
Reported-by: Fermín Serna <fermin@semmle.com>
15
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
16
(cherry picked from commit 741a8a08ebe5bc3ccfe3cde6c2b44ee53891af21)
17
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
18
---
19
net/nfs.c | 3 +++
20
1 file changed, 3 insertions(+)
21
22
diff --git a/net/nfs.c b/net/nfs.c
23
index d6a7f8e827..b7cf3b3a18 100644
24
--- a/net/nfs.c
25
+++ b/net/nfs.c
26
27
28
debug("%s\n", __func__);
29
30
+ if (len > sizeof(struct rpc_t))
31
+ return;
32
+
33
if (dest != nfs_our_port)
34
return;
35
36