Compare commits

...

9 Commits
rawhide ... f8

Author SHA1 Message Date
Fedora Release Engineering d28a7c4ca0 dist-git conversion 2010-07-29 04:12:15 +00:00
Bill Nottingham 0bdda31d86 Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-26 01:22:34 +00:00
Jan Šafránek c6ba513c0d fix CVE-2008-4309 Resolves: CVE-2008-4309 2008-11-03 08:53:50 +00:00
Jan Šafránek 20b42b3e30 explicitly require the right version and release of net-snmp and
net-snmp-libs Resolves: #451225
2008-11-03 08:32:56 +00:00
Jan Šafránek 69452fb8d1 fix various flaws (CVE-2008-2292 CVE-2008-0960) 2008-06-10 06:03:51 +00:00
Jan Šafránek ff2676e068 fixing ipNetToMediaNetAddress to show IP address Resolves: #432780 2008-02-14 11:48:56 +00:00
Jan Šafránek 85b9aaa800 fix crash on reading xen interfaces Resolves: #386611 2007-11-16 11:06:16 +00:00
Jan Šafránek d38fd0083d added procps to build dependencies Resolves: #380321 2007-11-15 10:48:20 +00:00
Jesse Keating 961ed50906 Initialize branch F-8 for net-snmp 2007-10-20 17:43:55 +00:00
8 changed files with 378 additions and 29 deletions

View File

View File

@ -1,21 +0,0 @@
# Makefile for source rpm: net-snmp
# $Id: Makefile,v 1.1 2004/09/09 09:07:47 cvsdist Exp $
NAME := net-snmp
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attempt a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

View File

@ -83,9 +83,10 @@
return (u_char *) LowPhysAddr;
case IPMEDIANETADDRESS: /* also ATNETADDRESS */
- *var_len = sizeof(uint32_t);
+ *var_len = sizeof addr_ret;
long_return = LowAddr;
- long_return = LowAddr;
- return (u_char *) & long_return;
+ *var_len = sizeof addr_ret;
+ addr_ret = LowAddr;
+ return (u_char *) & addr_ret;
case IPMEDIATYPE:
*var_len = sizeof long_return;

View File

@ -0,0 +1,64 @@
CVE-2008-4309: net-snmp: numresponses calculation integer overflow in snmp_agent.c
Source: upstream, http://net-snmp.svn.sourceforge.net/viewvc/net-snmp?view=rev&revision=17272
Index: clean/agent/snmp_agent.c
===================================================================
--- clean.orig/agent/snmp_agent.c 2008-10-28 23:12:10.000000000 +0100
+++ clean/agent/snmp_agent.c 2008-10-28 23:15:11.000000000 +0100
@@ -2234,7 +2234,6 @@
r = 0;
asp->bulkcache = NULL;
} else {
- int numresponses;
int maxbulk =
netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_MAX_GETBULKREPEATS);
@@ -2245,28 +2244,31 @@
if (maxresponses == 0)
maxresponses = 100; /* more than reasonable default */
- if (maxbulk == 0)
- maxbulk = -1;
+ /* ensure that the total number of responses fits in a mallocable
+ * result vector
+ */
+ if (maxresponses < 0 ||
+ maxresponses > INT_MAX / sizeof(struct varbind_list *))
+ maxresponses = INT_MAX / sizeof(struct varbind_list *);
+
+ /* ensure that the maximum number of repetitions will fit in the
+ * result vector
+ */
+ if (maxbulk <= 0 || maxbulk > maxresponses / r)
+ maxbulk = maxresponses / r;
/* limit getbulk number of repeats to a configured size */
- if (asp->pdu->errindex > maxbulk && maxbulk != -1) {
+ if (asp->pdu->errindex > maxbulk) {
asp->pdu->errindex = maxbulk;
- }
-
- numresponses = asp->pdu->errindex * r;
-
- /* limit getbulk number of getbulk responses to a configured size */
- if (maxresponses != -1 && numresponses > maxresponses) {
- /* attempt to truncate this */
- asp->pdu->errindex = maxresponses/r;
- numresponses = asp->pdu->errindex * r;
- DEBUGMSGTL(("snmp_agent", "truncating number of getbulk repeats to %d\n", asp->pdu->errindex));
+ DEBUGMSGTL(("snmp_agent",
+ "truncating number of getbulk repeats to %d\n",
+ asp->pdu->errindex));
}
asp->bulkcache =
- (netsnmp_variable_list **) malloc(numresponses *
- sizeof(struct
- varbind_list *));
+ (netsnmp_variable_list **) malloc(
+ asp->pdu->errindex * r * sizeof(struct varbind_list *));
+
if (!asp->bulkcache) {
DEBUGMSGTL(("snmp_agent", "Bulkcache malloc failed\n"));
return SNMP_ERR_GENERR;

View File

@ -0,0 +1,18 @@
447974: CVE-2008-0960 net-snmp SNMPv3 authentication bypass (VU#877044)
Source: upstream, https://sourceforge.net/tracker/index.php?func=detail&aid=1989089&group_id=12694&atid=456380
Reviewed-by: Jan Safranek <jsafrane@redhat.com>
diff -up net-snmp-5.0.9/snmplib/scapi.c.orig net-snmp-5.0.9/snmplib/scapi.c
--- net-snmp-5.0.9/snmplib/scapi.c.orig 2008-06-04 10:19:26.000000000 +0200
+++ net-snmp-5.0.9/snmplib/scapi.c 2008-06-04 10:20:45.000000000 +0200
@@ -460,6 +460,9 @@ sc_check_keyed_hash(const oid * authtype
QUITFUN(SNMPERR_GENERR, sc_check_keyed_hash_quit);
}
+ if (maclen != USM_MD5_AND_SHA_AUTH_LEN) {
+ QUITFUN(SNMPERR_GENERR, sc_check_keyed_hash_quit);
+ }
/*
* Generate a full hash of the message, then compare

View File

@ -0,0 +1,106 @@
447262: CVE-2008-2292 net-snmp: buffer overflow in perl module's Perl Module __snprint_value()
Source: upstream, http://net-snmp.svn.sourceforge.net/viewvc/net-snmp?view=rev&sortby=date&revision=16770
Reviewed-By: Jan Safranek <jsafrane@redhat.com>
--- branches/V5-4-patches/net-snmp/perl/SNMP/SNMP.xs 2007/12/21 23:19:29 16769
+++ branches/V5-4-patches/net-snmp/perl/SNMP/SNMP.xs 2007/12/22 19:22:44 16770
@@ -470,14 +470,16 @@
if (flag == USE_ENUMS) {
for(ep = tp->enums; ep; ep = ep->next) {
if (ep->value == *var->val.integer) {
- strcpy(buf, ep->label);
+ strncpy(buf, ep->label, buf_len);
+ buf[buf_len-1] = '\0';
len = strlen(buf);
break;
}
}
}
if (!len) {
- sprintf(buf,"%ld", *var->val.integer);
+ snprintf(buf, buf_len, "%ld", *var->val.integer);
+ buf[buf_len-1] = '\0';
len = strlen(buf);
}
break;
@@ -486,21 +488,25 @@
case ASN_COUNTER:
case ASN_TIMETICKS:
case ASN_UINTEGER:
- sprintf(buf,"%lu", (unsigned long) *var->val.integer);
+ snprintf(buf, buf_len, "%lu", (unsigned long) *var->val.integer);
+ buf[buf_len-1] = '\0';
len = strlen(buf);
break;
case ASN_OCTET_STR:
case ASN_OPAQUE:
- memcpy(buf, (char*)var->val.string, var->val_len);
len = var->val_len;
+ if ( len > buf_len )
+ len = buf_len;
+ memcpy(buf, (char*)var->val.string, len);
break;
case ASN_IPADDRESS:
- ip = (u_char*)var->val.string;
- sprintf(buf, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
- len = strlen(buf);
- break;
+ ip = (u_char*)var->val.string;
+ snprintf(buf, buf_len, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
+ buf[buf_len-1] = '\0';
+ len = strlen(buf);
+ break;
case ASN_NULL:
break;
@@ -512,14 +518,14 @@
break;
case SNMP_ENDOFMIBVIEW:
- sprintf(buf,"%s", "ENDOFMIBVIEW");
- break;
+ snprintf(buf, buf_len, "%s", "ENDOFMIBVIEW");
+ break;
case SNMP_NOSUCHOBJECT:
- sprintf(buf,"%s", "NOSUCHOBJECT");
- break;
+ snprintf(buf, buf_len, "%s", "NOSUCHOBJECT");
+ break;
case SNMP_NOSUCHINSTANCE:
- sprintf(buf,"%s", "NOSUCHINSTANCE");
- break;
+ snprintf(buf, buf_len, "%s", "NOSUCHINSTANCE");
+ break;
case ASN_COUNTER64:
#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
@@ -538,19 +544,19 @@
#endif
case ASN_BIT_STR:
- snprint_bitstring(buf, sizeof(buf), var, NULL, NULL, NULL);
+ snprint_bitstring(buf, buf_len, var, NULL, NULL, NULL);
len = strlen(buf);
break;
#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
case ASN_OPAQUE_FLOAT:
- if (var->val.floatVal)
- sprintf(buf,"%f", *var->val.floatVal);
- break;
+ if (var->val.floatVal)
+ snprintf(buf, buf_len, "%f", *var->val.floatVal);
+ break;
case ASN_OPAQUE_DOUBLE:
- if (var->val.doubleVal)
- sprintf(buf,"%f", *var->val.doubleVal);
- break;
+ if (var->val.doubleVal)
+ snprintf(buf, buf_len, "%f", *var->val.doubleVal);
+ break;
#endif
case ASN_NSAP:

View File

@ -0,0 +1,157 @@
386611: snmpd segfaults on xen network interfaces
Source: http://sourceforge.net/tracker/index.php?func=detail&aid=1794532&group_id=12694&atid=112694
Reviewed-By: Jan Safranek <jsafrane@redhat.com>
Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
===================================================================
--- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c (revision 16711)
+++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c (working copy)
@@ -258,9 +258,10 @@
if ((NULL != rowreq_ctx) &&
(MFD_SUCCESS ==
ipAddressTable_indexes_set(rowreq_ctx,
+ ipaddress_entry->ia_address_len + 1,
+ ipaddress_entry->ia_address,
ipaddress_entry->ia_address_len,
- ipaddress_entry->ia_address,
- ipaddress_entry->ia_address_len))) {
+ ipaddress_entry->if_index))) {
if (CONTAINER_INSERT(container, rowreq_ctx) < 0) {
DEBUGMSGTL (("ipAddressTable:access","container insert failed for new entry\n"));
ipAddressTable_release_rowreq_ctx(rowreq_ctx);
Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
===================================================================
--- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c (revision 16711)
+++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c (working copy)
@@ -348,10 +348,18 @@
*mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV4;
break;
+ case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4Z:
+ *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV4Z;
+ break;
+
case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6:
*mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV6;
break;
+ case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6Z:
+ *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV6Z;
+ break;
+
default:
snmp_log(LOG_ERR, "couldn't map value %ld for ipAddressAddrType\n",
raw_ipAddressAddrType_val);
@@ -382,8 +390,11 @@
ipAddressTable_indexes_set_tbl_idx(ipAddressTable_mib_index * tbl_idx,
u_long ipAddressAddrType_val,
char *ipAddressAddr_val_ptr,
- size_t ipAddressAddr_val_ptr_len)
+ size_t ipAddressAddr_val_ptr_len,
+ u_long ipAddressAddr_ifIndex)
{
+ uint32_t zone = htonl(ipAddressAddr_ifIndex);
+
DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set_tbl_idx", "called\n"));
/*
@@ -409,6 +420,11 @@
memcpy(tbl_idx->ipAddressAddr, ipAddressAddr_val_ptr,
ipAddressAddr_val_ptr_len * sizeof(ipAddressAddr_val_ptr[0]));
+ /** zone */
+ tbl_idx->ipAddressAddr_len += sizeof(zone);
+ memcpy(&tbl_idx->ipAddressAddr[ipAddressAddr_val_ptr_len *
+ sizeof(ipAddressAddr_val_ptr[0])],
+ &zone, sizeof(zone));
return MFD_SUCCESS;
} /* ipAddressTable_indexes_set_tbl_idx */
@@ -430,7 +446,8 @@
ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
u_long ipAddressAddrType_val,
char *ipAddressAddr_val_ptr,
- size_t ipAddressAddr_val_ptr_len)
+ size_t ipAddressAddr_val_ptr_len,
+ u_long ipAddressAddr_ifIndex)
{
DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set",
"called\n"));
@@ -439,7 +456,8 @@
ipAddressTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
ipAddressAddrType_val,
ipAddressAddr_val_ptr,
- ipAddressAddr_val_ptr_len))
+ ipAddressAddr_val_ptr_len,
+ ipAddressAddr_ifIndex))
return MFD_ERROR;
/*
Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
===================================================================
--- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h (revision 16711)
+++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h (working copy)
@@ -106,7 +106,9 @@
* simplistic map of address length to type
*/
#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4 4
+#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4Z 5
#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6 16
+#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6Z 17
/*************************************************************
Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
===================================================================
--- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h (revision 16711)
+++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h (working copy)
@@ -273,14 +273,16 @@
u_long ipAddressAddrType_val,
char *ipAddressAddr_val_ptr,
size_t
- ipAddressAddr_val_ptr_len);
+ ipAddressAddr_val_ptr_len,
+ u_long ipAddressAddr_ifIndex);
int ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx *
rowreq_ctx,
u_long
ipAddressAddrType_val,
char *ipAddressAddr_val_ptr,
size_t
- ipAddressAddr_val_ptr_len);
+ ipAddressAddr_val_ptr_len,
+ u_long ipAddressAddr_ifIndex);
Index: agent/mibgroup/ip-mib/data_access/ipaddress_common.c
===================================================================
--- agent/mibgroup/ip-mib/data_access/ipaddress_common.c (revision 16711)
+++ agent/mibgroup/ip-mib/data_access/ipaddress_common.c (working copy)
@@ -411,6 +415,7 @@
{
const netsnmp_ipaddress_entry *lh = (const netsnmp_ipaddress_entry *)lhs;
const netsnmp_ipaddress_entry *rh = (const netsnmp_ipaddress_entry *)rhs;
+ int rc;
netsnmp_assert(NULL != lhs);
netsnmp_assert(NULL != rhs);
@@ -426,5 +431,17 @@
/*
* length equal, compare address
*/
- return memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
+ rc = memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
+ if (rc)
+ return rc;
+
+ /*
+ * address same, compare ifIndex
+ */
+ if (lh->if_index < rh->if_index)
+ return -1;
+ else if (lh->if_index > rh->if_index)
+ return 1;
+
+ return 0;
}

View File

@ -7,7 +7,7 @@
Summary: A collection of SNMP protocol tools and libraries
Name: net-snmp
Version: %{major_ver}
Release: 4%{?dist}
Release: 8%{?dist}
Epoch: 1
License: BSD and CMU
@ -37,16 +37,21 @@ Patch12: net-snmp-5.4.1-hostname.patch
Patch13: net-snmp-5.4.1-shared-ip.patch
Patch14: net-snmp-5.4-exec-crash.patch
Patch15: net-snmp-5.1.2-snmpconf-selinux.patch
Patch16: net-snmp-5.4.1-xen-crash.patch
Patch17: net-snmp-5.4.1-hmac-check.patch
Patch18: net-snmp-5.4.1-perl-snprintf.patch
Patch19: net-snmp-5.4.1-getbulk-crash.patch
Requires(pre): /sbin/chkconfig
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
Requires(preun): /bin/rm
Requires: %{name}-libs = %{epoch}:%{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: openssl-devel, bzip2-devel, beecrypt-devel, elfutils-devel
BuildRequires: openssl-devel, bzip2-devel, elfutils-devel
BuildRequires: libselinux-devel, elfutils-libelf-devel, rpm-devel
BuildRequires: perl-devel, gawk
BuildRequires: perl-devel, gawk, procps
%ifnarch s390 s390x
BuildRequires: lm_sensors-devel
%endif
@ -76,7 +81,7 @@ Building option:
%package utils
Group: Applications/System
Summary: Network management utilities using SNMP, from the NET-SNMP project
Requires: %{name} = %{epoch}:%{version}
Requires: %{name} = %{epoch}:%{version}-%{release}
%description utils
The net-snmp-utils package contains various utilities for use with the
@ -89,7 +94,7 @@ package.
%package devel
Group: Development/Libraries
Summary: The development environment for the NET-SNMP project
Requires: %{name} = %{epoch}:%{version}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: beecrypt-devel, elfutils-devel, rpm-devel, elfutils-libelf-devel
%if %{tcp_wrappers}
Requires: tcp_wrappers-devel
@ -111,7 +116,7 @@ packages installed.
%package perl
Group: Development/Libraries
Summary: The perl NET-SNMP module and the mib2c tool
Requires: %{name} = %{epoch}:%{version}, perl >= 5
Requires: %{name} = %{epoch}:%{version}-%{release}, perl >= 5
BuildRequires: perl >= 5
%description perl
@ -149,6 +154,10 @@ and applications.
%patch13 -p1 -b .shared-ip
%patch14 -p1 -b .exec
%patch15 -p1 -b .selinux
%patch16 -p0 -b .xen-crash
%patch17 -p1 -b .hmac-check
%patch18 -p3 -b .perl-snprintf
%patch19 -p1 -b .getbulk-crash
# Do this patch with a perl hack...
perl -pi -e "s|'\\\$install_libdir'|'%{_libdir}'|" ltmain.sh
@ -358,6 +367,21 @@ rm -rf ${RPM_BUILD_ROOT}
%{_libdir}/lib*.so.*
%changelog
* Mon Jun 23 2008 Jan Safranek <jsafranek@redhat.com> 5.4.1-8
- explicitly require the right version and release of net-snmp and
net-snmp-libs (#451225)
- fix CVE-2008-4309
* Tue Jun 10 2008 Jan Safranek <jsafranek@redhat.com> 5.4.1-7
- fix various flaws (CVE-2008-2292 CVE-2008-0960)
* Thu Feb 14 2008 Jan Safranek <jsafranek@redhat.com> 5.4.1-6
- fixing ipNetToMediaNetAddress to show IP address (#432780)
* Thu Nov 15 2007 Jan Safranek <jsafranek@redhat.com> 5.4.1-5
- added procps to build dependencies (#380321)
- fix crash on reading xen interfaces (#386611)
* Tue Oct 16 2007 Jan Safranek <jsafranek@redhat.com> 5.4.1-4
- License: field fixed to "BSD and CMU"