Sync fixes with RHEL
This commit is contained in:
parent
e4b67c5f99
commit
491853f2e5
129
net-snmp-5.9-CVE-2022-44792-44793.patch
Normal file
129
net-snmp-5.9-CVE-2022-44792-44793.patch
Normal file
@ -0,0 +1,129 @@
|
||||
From 4589352dac3ae111c7621298cf231742209efd9b Mon Sep 17 00:00:00 2001
|
||||
From: Bill Fenner <fenner@gmail.com>
|
||||
Date: Fri, 25 Nov 2022 08:41:24 -0800
|
||||
Subject: [PATCH 1/3] snmp_agent: disallow SET with NULL varbind
|
||||
|
||||
---
|
||||
agent/snmp_agent.c | 32 ++++++++++++++++++++++++++++++++
|
||||
1 file changed, 32 insertions(+)
|
||||
|
||||
diff --git a/agent/snmp_agent.c b/agent/snmp_agent.c
|
||||
index 867d0c166f..3f678fe2df 100644
|
||||
--- a/agent/snmp_agent.c
|
||||
+++ b/agent/snmp_agent.c
|
||||
@@ -3719,12 +3719,44 @@ netsnmp_handle_request(netsnmp_agent_session *asp, int status)
|
||||
return 1;
|
||||
}
|
||||
|
||||
+static int
|
||||
+check_set_pdu_for_null_varbind(netsnmp_agent_session *asp)
|
||||
+{
|
||||
+ int i;
|
||||
+ netsnmp_variable_list *v = NULL;
|
||||
+
|
||||
+ for (i = 1, v = asp->pdu->variables; v != NULL; i++, v = v->next_variable) {
|
||||
+ if (v->type == ASN_NULL) {
|
||||
+ /*
|
||||
+ * Protect SET implementations that do not protect themselves
|
||||
+ * against wrong type.
|
||||
+ */
|
||||
+ DEBUGMSGTL(("snmp_agent", "disallowing SET with NULL var for varbind %d\n", i));
|
||||
+ asp->index = i;
|
||||
+ return SNMP_ERR_WRONGTYPE;
|
||||
+ }
|
||||
+ }
|
||||
+ return SNMP_ERR_NOERROR;
|
||||
+}
|
||||
+
|
||||
int
|
||||
handle_pdu(netsnmp_agent_session *asp)
|
||||
{
|
||||
int status, inclusives = 0;
|
||||
netsnmp_variable_list *v = NULL;
|
||||
|
||||
+#ifndef NETSNMP_NO_WRITE_SUPPORT
|
||||
+ /*
|
||||
+ * Check for ASN_NULL in SET request
|
||||
+ */
|
||||
+ if (asp->pdu->command == SNMP_MSG_SET) {
|
||||
+ status = check_set_pdu_for_null_varbind(asp);
|
||||
+ if (status != SNMP_ERR_NOERROR) {
|
||||
+ return status;
|
||||
+ }
|
||||
+ }
|
||||
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
|
||||
+
|
||||
/*
|
||||
* for illegal requests, mark all nodes as ASN_NULL
|
||||
*/
|
||||
|
||||
From 7f4ac4051cc7fec6a5944661923acb95cec359c7 Mon Sep 17 00:00:00 2001
|
||||
From: Bill Fenner <fenner@gmail.com>
|
||||
Date: Fri, 25 Nov 2022 08:41:46 -0800
|
||||
Subject: [PATCH 2/3] apps: snmpset: allow SET with NULL varbind for testing
|
||||
|
||||
---
|
||||
apps/snmpset.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/apps/snmpset.c b/apps/snmpset.c
|
||||
index 48e14bd513..d542713e1b 100644
|
||||
--- a/apps/snmpset.c
|
||||
+++ b/apps/snmpset.c
|
||||
@@ -182,6 +182,7 @@ main(int argc, char *argv[])
|
||||
case 'x':
|
||||
case 'd':
|
||||
case 'b':
|
||||
+ case 'n': /* undocumented */
|
||||
#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
|
||||
case 'I':
|
||||
case 'U':
|
||||
|
||||
From 15f9d7f7e5b90c9b419832ed8e6413feb6570d83 Mon Sep 17 00:00:00 2001
|
||||
From: Bill Fenner <fenner@gmail.com>
|
||||
Date: Fri, 25 Nov 2022 10:23:32 -0800
|
||||
Subject: [PATCH 3/3] Add test for NULL varbind set
|
||||
|
||||
---
|
||||
.../default/T0142snmpv2csetnull_simple | 31 +++++++++++++++++++
|
||||
1 file changed, 31 insertions(+)
|
||||
create mode 100644 testing/fulltests/default/T0142snmpv2csetnull_simple
|
||||
|
||||
diff --git a/testing/fulltests/default/T0142snmpv2csetnull_simple b/testing/fulltests/default/T0142snmpv2csetnull_simple
|
||||
new file mode 100644
|
||||
index 0000000000..0f1b8f386b
|
||||
--- /dev/null
|
||||
+++ b/testing/fulltests/default/T0142snmpv2csetnull_simple
|
||||
@@ -0,0 +1,31 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
+. ../support/simple_eval_tools.sh
|
||||
+
|
||||
+HEADER SNMPv2c set of system.sysContact.0 with NULL varbind
|
||||
+
|
||||
+SKIPIF NETSNMP_DISABLE_SET_SUPPORT
|
||||
+SKIPIF NETSNMP_NO_WRITE_SUPPORT
|
||||
+SKIPIF NETSNMP_DISABLE_SNMPV2C
|
||||
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
|
||||
+
|
||||
+#
|
||||
+# Begin test
|
||||
+#
|
||||
+
|
||||
+# standard V2C configuration: testcomunnity
|
||||
+snmp_write_access='all'
|
||||
+. ./Sv2cconfig
|
||||
+STARTAGENT
|
||||
+
|
||||
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0"
|
||||
+
|
||||
+CHECK ".1.3.6.1.2.1.1.4.0 = STRING:"
|
||||
+
|
||||
+CAPTURE "snmpset -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0 n x"
|
||||
+
|
||||
+CHECK "Reason: wrongType"
|
||||
+
|
||||
+STOPAGENT
|
||||
+
|
||||
+FINISHED
|
||||
|
12
net-snmp-5.9-ipv6-disable-leak.patch
Normal file
12
net-snmp-5.9-ipv6-disable-leak.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -urNp a/snmplib/snmp_logging.c b/snmplib/snmp_logging.c
|
||||
--- a/snmplib/snmp_logging.c 2023-02-15 10:19:15.691827254 +0100
|
||||
+++ b/snmplib/snmp_logging.c 2023-02-15 10:24:41.006642974 +0100
|
||||
@@ -490,7 +490,7 @@ snmp_log_options(char *optarg, int argc,
|
||||
char *
|
||||
snmp_log_syslogname(const char *pstr)
|
||||
{
|
||||
- if (pstr)
|
||||
+ if (pstr && (pstr != syslogname))
|
||||
strlcpy (syslogname, pstr, sizeof(syslogname));
|
||||
|
||||
return syslogname;
|
@ -10,7 +10,7 @@
|
||||
Summary: A collection of SNMP protocol tools and libraries
|
||||
Name: net-snmp
|
||||
Version: 5.9.3
|
||||
Release: 6%{?dist}
|
||||
Release: 7%{?dist}
|
||||
Epoch: 1
|
||||
|
||||
License: Net-SNMP and OpenSSL
|
||||
@ -49,6 +49,8 @@ Patch19: net-snmp-5.9-intermediate-certs.patch
|
||||
Patch20: net-snmp-5.9.1-remove-des.patch
|
||||
Patch21: net-snmp-5.9.1-autoconf.patch
|
||||
Patch22: net-snmp-libs-misunderstanding.patch
|
||||
Patch23: net-snmp-5.9-CVE-2022-44792-44793.patch
|
||||
Patch24: net-snmp-5.9-ipv6-disable-leak.patch
|
||||
|
||||
# Modern RPM API means at least EL6
|
||||
Patch101: net-snmp-5.8-modern-rpm-api.patch
|
||||
@ -222,6 +224,8 @@ cp %{SOURCE10} .
|
||||
%patch 20 -p1 -b .remove-des
|
||||
%patch 21 -p1 -b .autoconf
|
||||
%patch 22 -p1
|
||||
%patch 23 -p1
|
||||
%patch 24 -p1 -b .ipv6-disable-leak
|
||||
|
||||
%patch 101 -p1 -b .modern-rpm-api
|
||||
%patch 102 -p1
|
||||
@ -490,6 +494,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test
|
||||
%{_libdir}/libnetsnmptrapd*.so.%{soname}*
|
||||
|
||||
%changelog
|
||||
* Tue Aug 01 2023 Josef Ridky <jridky@redhat.com> - 1:5.9.3-7
|
||||
- Sync fixes with RHEL
|
||||
|
||||
* Wed Jul 19 2023 Josef Ridky <jridky@redhat.com> - 1:5.9.3-6
|
||||
- Migrate to SPDX license format
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user