diff --git a/SOURCES/net-snmp-5.9-trapsink-fd-leak.patch b/SOURCES/net-snmp-5.9-trapsink-fd-leak.patch new file mode 100644 index 0000000..f490f64 --- /dev/null +++ b/SOURCES/net-snmp-5.9-trapsink-fd-leak.patch @@ -0,0 +1,27 @@ +--- a/agent/mibgroup/notification/snmpNotifyTable_data.c 2026-06-04 10:57:46.002930495 +0200 ++++ b/agent/mibgroup/notification/snmpNotifyTable_data.c 2026-06-04 10:58:29.117839031 +0200 +@@ -493,13 +493,6 @@ snmpNotifyTable_dispose(struct snmpNotif + --_active; + } + +-/* +- * XXX: this really needs to be done for the target mib entries too. +- * But we can only trust that we've added stuff here and we don't want +- * to destroy other valid entries in the target tables, so... Don't +- * do too many kill -HUPs to your agent as re reading the config file +- * will be a slow memory leak in the target mib. +- */ + int + notifyTable_unregister_all_notifications(int major, int minor, + void *serverarg, void *clientarg) +@@ -510,8 +503,8 @@ notifyTable_unregister_all_notifications + struct snmpNotifyTable_data *nptr = hptr->data; + nhptr = hptr->next; + if (nptr->snmpNotifyStorageType == ST_READONLY) { +- header_complex_extract_entry(&snmpNotifyTableStorage, hptr); +- snmpNotifyTable_dispose(nptr); ++ snmpNotifyTable_unregister_notification(nptr->snmpNotifyName, ++ nptr->snmpNotifyNameLen); + } + } + snmpNotifyTableStorage = NULL; diff --git a/SPECS/net-snmp.spec b/SPECS/net-snmp.spec index f8a2ea8..6f92f42 100644 --- a/SPECS/net-snmp.spec +++ b/SPECS/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 21%{?dist} +Release: 22%{?dist} Epoch: 1 License: BSD @@ -67,6 +67,7 @@ Patch36: net-snmp-5.9.1-create-user-usage.patch Patch37: net-snmp-5.9-remove-assert.patch Patch38: net-snmp-5.9.4-oob-access.patch Patch39: net-snmp-5.9.4-tls.patch +Patch40: net-snmp-5.9-trapsink-fd-leak.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -260,6 +261,7 @@ cp %{SOURCE10} . %patch37 -p1 -b .remove-assert %patch38 -p1 -b .oob-access %patch39 -p1 -b .tls-allow +%patch40 -p1 -b .trapsink-fd-leak %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -531,6 +533,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Mon Jun 08 2026 Josef Ridky - 1:5.9.1-22 +- fix file descriptor leak in trap sink on SIGHUP reload (RHEL-78225) + * Mon Feb 02 2026 Josef Ridky - 1:5.9.1-21 - fix creation of /var/lib/net-snmp in image mode (RHEL-132655)