Browse code

net-snmp: fix for CVE-2018-18065

Added a patch to fix the CVE

Change-Id: If6d2ee3d7fcf5b8baa95cb4ce0d32cac89d7c5e2
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/6423
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>

Ankit Jain authored on 2019/01/01 03:36:51
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,33 @@
0
+From 7ffb8e25a0db851953155de91f0170e9bf8c457d Mon Sep 17 00:00:00 2001
1
+From: Robert Story <rstory@freesnmp.com>
2
+Date: Thu, 6 Oct 2016 10:43:10 -0400
3
+Subject: [PATCH] CHANGES: BUG: 2743: snmpd crashes when receiving a GetNext
4
+ PDU with multiple Varbinds
5
+
6
+skip out-of-range varbinds when calling next handler
7
+---
8
+ agent/helpers/table.c | 4 ++++
9
+ 1 file changed, 4 insertions(+)
10
+
11
+diff --git a/agent/helpers/table.c b/agent/helpers/table.c
12
+index 882e84c..b943d6e 100644
13
+--- a/agent/helpers/table.c
14
+@@ -406,6 +406,8 @@ table_helper_handler(netsnmp_mib_handler *handler,
15
+             if (reqinfo->mode == MODE_GET)
16
+                 table_helper_cleanup(reqinfo, request,
17
+                                      SNMP_NOSUCHOBJECT);
18
++            else
19
++                request->processed = 1; /* skip if next handler called */
20
+             continue;
21
+         }
22
+ 
23
+@@ -483,6 +485,8 @@ table_helper_handler(netsnmp_mib_handler *handler,
24
+ #endif /* NETSNMP_NO_WRITE_SUPPORT */
25
+                     table_helper_cleanup(reqinfo, request,
26
+                                          SNMP_NOSUCHOBJECT);
27
++                else
28
++                    request->processed = 1; /* skip if next handler called */
29
+                 continue;
30
+             }
31
+             /*
... ...
@@ -2,7 +2,7 @@
2 2
 Summary:        Net-SNMP is a suite of applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6. 
3 3
 Name:           net-snmp   
4 4
 Version:        5.7.3
5
-Release:        6%{?dist}
5
+Release:        7%{?dist}
6 6
 License:        BSD (like)  
7 7
 URL:            http://net-snmp.sourceforge.net/
8 8
 Group:          Productivity/Networking/Other
... ...
@@ -14,6 +14,7 @@ Patch1:         net-snmp-5.7.2-systemd.patch
14 14
 Patch2:         net-snmp-CVE-2018-1000116.patch
15 15
 Patch3:         net-snmp-remove-u64-typedef.patch
16 16
 Patch4:         net-snmp-fix-perl-module-compilation.patch
17
+Patch5:         net-snmp-CVE-2018-18065.patch
17 18
 BuildRequires:  openssl-devel perl systemd
18 19
 Requires:       perl systemd
19 20
 Requires:       perl = 5.24.1
... ...
@@ -34,6 +35,7 @@ The net-snmp-devel package contains headers and libraries for building SNMP appl
34 34
 %patch2 -p1
35 35
 %patch3 -p1
36 36
 %patch4 -p1
37
+%patch5 -p1
37 38
 
38 39
 %build
39 40
 ./configure --prefix=%{_prefix} \
... ...
@@ -119,6 +121,8 @@ rm -rf %{buildroot}/*
119 119
 %exclude /usr/lib/perl5/5.22.1/x86_64-linux-thread-multi/perllocal.pod
120 120
 
121 121
 %changelog
122
+*   Mon Dec 31 2018 Ankit Jain <ankitja@vmware.com> 5.7.3-7
123
+-   Fix for CVE-2018-18065
122 124
 *   Wed Jun 06 2018 Xiaolin Li <xiaolinl@vmware.com> 5.7.3-6
123 125
 -   Bump release after upgraded perl to 5.24.1
124 126
 *   Wed Apr 18 2018 Xiaolin Li <xaiolinl@vmware.com> 5.7.3-5