From a1af22f2061d9dff4c1c667c51f6aecd6fec0450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Wed, 16 Aug 2023 11:55:04 +0200 Subject: [PATCH] New upstream release 5.9.4 (#2184202) --- .gitignore | 1 + net-snmp-5.9-CVE-2022-44792-44793.patch | 129 ------------------------ net-snmp-5.9-sendmsg-error-code.patch | 31 ------ net-snmp-5.9.1-autoconf.patch | 6 -- net-snmp.spec | 25 ++--- sources | 2 +- 6 files changed, 13 insertions(+), 181 deletions(-) delete mode 100644 net-snmp-5.9-CVE-2022-44792-44793.patch delete mode 100644 net-snmp-5.9-sendmsg-error-code.patch delete mode 100644 net-snmp-5.9.1-autoconf.patch diff --git a/.gitignore b/.gitignore index 2467898..c94eb56 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ net-snmp-5.5.tar.gz /net-snmp-5.9.tar.gz /net-snmp-5.9.1.tar.gz /net-snmp-5.9.3.tar.gz +/net-snmp-5.9.4.tar.gz diff --git a/net-snmp-5.9-CVE-2022-44792-44793.patch b/net-snmp-5.9-CVE-2022-44792-44793.patch deleted file mode 100644 index 4b48b14..0000000 --- a/net-snmp-5.9-CVE-2022-44792-44793.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 4589352dac3ae111c7621298cf231742209efd9b Mon Sep 17 00:00:00 2001 -From: Bill Fenner -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 -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 -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 - diff --git a/net-snmp-5.9-sendmsg-error-code.patch b/net-snmp-5.9-sendmsg-error-code.patch deleted file mode 100644 index 6709cef..0000000 --- a/net-snmp-5.9-sendmsg-error-code.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 298c8103db80b292791616af4fd497342a71867f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= -Date: Wed, 24 May 2023 10:49:41 +0200 -Subject: [PATCH] libsnmp, UDP transport: Fix sendmsg() error code handling - -This change has been made because of Linux kernel commit "ipv4: Return --ENETUNREACH if we can't create route but saddr is valid" -(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=595e0651d029) - -Fixes: https://github.com/net-snmp/net-snmp/issues/564 -Fixes: https://github.com/net-snmp/net-snmp/pull/576 - -[ bvanassche: edited commit message ] ---- - snmplib/transports/snmpUDPBaseDomain.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/snmplib/transports/snmpUDPBaseDomain.c b/snmplib/transports/snmpUDPBaseDomain.c -index ca8f9a5554..cd6b15e2ad 100644 ---- a/snmplib/transports/snmpUDPBaseDomain.c -+++ b/snmplib/transports/snmpUDPBaseDomain.c -@@ -315,7 +315,7 @@ int netsnmp_udpbase_sendto_unix(int fd, const struct in_addr *srcip, - sizeof(struct sockaddr)); - else - rc = sendmsg(fd, &m, MSG_DONTWAIT); -- if (rc >= 0 || errno != EINVAL) -+ if (rc >= 0 || (errno != EINVAL && errno != ENETUNREACH)) - return rc; - - /* - diff --git a/net-snmp-5.9.1-autoconf.patch b/net-snmp-5.9.1-autoconf.patch deleted file mode 100644 index 5c6b2a9..0000000 --- a/net-snmp-5.9.1-autoconf.patch +++ /dev/null @@ -1,6 +0,0 @@ -diff -urNp a/dist/autoconf-version b/dist/autoconf-version ---- a/dist/autoconf-version 2021-09-01 11:18:14.582110773 +0200 -+++ b/dist/autoconf-version 2021-09-01 11:20:16.804369533 +0200 -@@ -1 +1 @@ --2.69 -+2.71 diff --git a/net-snmp.spec b/net-snmp.spec index 7dcaa55..6103067 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -9,8 +9,8 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp -Version: 5.9.3 -Release: 8%{?dist} +Version: 5.9.4 +Release: 1%{?dist} Epoch: 1 License: Net-SNMP and OpenSSL @@ -47,12 +47,9 @@ Patch17: net-snmp-5.9-aes-config.patch Patch18: net-snmp-5.8-clientaddr-error-message.patch 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 -Patch25: net-snmp-5.9-sendmsg-error-code.patch -Patch26: net-snmp-5.9-rpmdb.patch +Patch21: net-snmp-libs-misunderstanding.patch +Patch22: net-snmp-5.9-ipv6-disable-leak.patch +Patch23: net-snmp-5.9-rpmdb.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -239,12 +236,9 @@ cp %{SOURCE10} . %patch 18 -p1 -b .clientaddr-error-message %patch 19 -p1 -b .intermediate-certs %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 25 -p1 -b .sendmsg-error-code -%patch 26 -p1 -b .rpmdbpatch +%patch 21 -p1 +%patch 22 -p1 -b .ipv6-disable-leak +%patch 23 -p1 -b .rpmdbpatch %patch 101 -p1 -b .modern-rpm-api %patch 102 -p1 @@ -515,6 +509,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Wed Aug 16 2023 Josef Ridky - 1:5.9.4-1 +- New upstream release 5.9.4 (#2184202) + * Mon Aug 14 2023 Josef Ridky - 1:5.9.3-8 - Fix warning for RPM DB - split perl module into separate package that doesn't pull in gcc and diff --git a/sources b/sources index 6889744..0d272db 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (net-snmp-5.9.3.tar.gz) = a476df4967029a2eb03d27b0e250170785d0a8c143d49b900ee958c3cbdfaccd415b70af40f6fbed9cb8819d522c35a6073a431091d908ccc7c018fa0aaa2abc +SHA512 (net-snmp-5.9.4.tar.gz) = a510fa91a21e9ddc86a12fd1d0bc6b356e63f3ea53f184d2e31439004d41d902390664134dc40b3b828eabb4282eaf3da628a07c4d480fa00eff7e700950c423