From owner-freebsd-ports-bugs@FreeBSD.ORG Sun May 24 18:20:02 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AEA410656A3 for ; Sun, 24 May 2009 18:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 69C678FC2C for ; Sun, 24 May 2009 18:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n4OIK1ab094253 for ; Sun, 24 May 2009 18:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n4OIK150094252; Sun, 24 May 2009 18:20:01 GMT (envelope-from gnats) Resent-Date: Sun, 24 May 2009 18:20:01 GMT Resent-Message-Id: <200905241820.n4OIK150094252@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Alexander V. Chernikov" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1266B1065676 for ; Sun, 24 May 2009 18:13:32 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 0034D8FC08 for ; Sun, 24 May 2009 18:13:32 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n4OIDVTv081538 for ; Sun, 24 May 2009 18:13:31 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n4OIDVnR081537; Sun, 24 May 2009 18:13:31 GMT (envelope-from nobody) Message-Id: <200905241813.n4OIDVnR081537@www.freebsd.org> Date: Sun, 24 May 2009 18:13:31 GMT From: "Alexander V. Chernikov" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/134915: [maintainer update] net/igmpproxy bugfix X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2009 18:20:04 -0000 >Number: 134915 >Category: ports >Synopsis: [maintainer update] net/igmpproxy bugfix >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Sun May 24 18:20:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Alexander V. Chernikov >Release: 8.0-CURRENT >Organization: >Environment: FreeBSD ws.ipfw.ru 8.0-CURRENT FreeBSD 8.0-CURRENT #3: Sun Apr 19 15:40:34 MSD 2009 root@ws.su29.net:/usr/obj/usr/src/sys/WS amd64 >Description: * Fix build on recent -CURRENT * Fix strcpy() buffer overflow >How-To-Repeat: >Fix: Apply patch Patch attached with submission follows: --- files/patch-freebsd.orig 2009-03-18 18:18:53.000000000 +0300 +++ files/patch-freebsd 2009-05-24 21:02:06.000000000 +0400 @@ -32,6 +32,29 @@ echo '#define BUILD "' `date +%y%m%d` '"' >build.h --- src/config.c.orig 2005-05-24 16:49:29.000000000 +0100 +++ src/config.c 2009-03-18 14:35:31.000000000 +0000 +@@ -39,16 +39,16 @@ + + // Structure to keep configuration for VIFs... + struct vifconfig { +- char* name; +- short state; +- int ratelimit; +- int threshold; ++ char name[IFNAMSIZ]; ++ short state; ++ int ratelimit; ++ int threshold; + + // Keep allowed nets for VIF. +- struct SubnetList* allowednets; ++ struct SubnetList* allowednets; + + // Next config in list... +- struct vifconfig* next; ++ struct vifconfig* next; + }; + + // Structure to keep vif configuration @@ -177,7 +177,7 @@ } @@ -41,7 +64,21 @@ if ( Dp->InAdr.s_addr && ! (Dp->Flags & IFF_LOOPBACK) ) { // Now try to find a matching config... -@@ -255,7 +255,7 @@ +@@ -240,12 +240,7 @@ + tmpPtr->state = IF_STATE_DOWNSTREAM; + tmpPtr->allowednets = NULL; + +- // Make a copy of the token to store the IF name +- tmpPtr->name = (char *)malloc( sizeof(char) * strlen(token) ); +- if(tmpPtr->name == NULL) { +- log(LOG_ERR, 0, "Out of memory."); +- } +- strcpy(tmpPtr->name, token); ++ strlcpy(tmpPtr->name, token, sizeof(tmpPtr->name)); + + // Set the altnet pointer to the allowednets pointer. + anetPtr = &tmpPtr->allowednets; +@@ -255,7 +250,7 @@ while(token != NULL) { if(strcmp("altnet", token)==0) { // Altnet... @@ -50,7 +87,7 @@ token = nextConfigToken(); IF_DEBUG log(LOG_DEBUG, 0, "Config: IF: Got altnet token %s.",token); -@@ -347,7 +347,7 @@ +@@ -347,7 +342,7 @@ mask <<= (32 - bitcnt); } @@ -61,7 +98,7 @@ } --- src/defs.h.orig 2005-08-20 13:44:47.000000000 +0100 +++ src/defs.h 2009-03-18 14:35:31.000000000 +0000 -@@ -40,10 +40,18 @@ +@@ -40,27 +40,46 @@ #include #include #include @@ -81,13 +118,16 @@ #include -@@ -52,15 +60,25 @@ +-// The multicats API needs linux spesific headers !!! ++// The multicats API needs linux specific headers !!! + #ifdef USE_LINUX_IN_H #include #include #else +#ifdef __FreeBSD__ + #include + #include ++ #include #include + #include +#endif @@ -108,7 +148,7 @@ #define ENABLE_DEBUG 1 /* -@@ -72,9 +90,31 @@ +@@ -72,9 +91,31 @@ #define MAX_MC_VIFS 32 // !!! check this const in the specific includes @@ -140,7 +180,7 @@ #define VCMC( Vc ) (sizeof( Vc ) / sizeof( (Vc)[ 0 ] )) #define VCEP( Vc ) (&(Vc)[ VCMC( Vc ) ]) -@@ -126,7 +166,12 @@ +@@ -126,7 +167,12 @@ #define IF_DEBUG if(Log2Stderr & LOG_DEBUG) @@ -154,7 +194,16 @@ /* ifvc.c */ -@@ -196,6 +241,7 @@ +@@ -161,7 +207,7 @@ + }; + + struct IfDesc { +- char Name[ sizeof( ((struct ifreq *)NULL)->ifr_name ) ]; ++ char Name[IFNAMSIZ]; + struct in_addr InAdr; /* == 0 for non IP interfaces */ + short Flags; + short state; +@@ -196,6 +242,7 @@ struct IfDesc *getIfByName( const char *IfName ); struct IfDesc *getIfByIx( unsigned Ix ); struct IfDesc *getIfByAddress( uint32 Ix ); @@ -162,7 +211,7 @@ /* mroute-api.c */ -@@ -235,7 +281,7 @@ +@@ -235,7 +282,7 @@ char *fmtInAdr( char *St, struct in_addr InAdr ); char *inetFmt(uint32 addr, char *s); char *inetFmts(uint32 addr, uint32 mask, char *s); @@ -171,7 +220,7 @@ /* kern.c */ -@@ -264,7 +310,7 @@ +@@ -264,7 +311,7 @@ void initRouteTable(); void clearAllRoutes(); int insertRoute(uint32 group, int ifx); --- Makefile.orig 2009-05-24 21:08:04.000000000 +0400 +++ Makefile 2009-05-24 21:09:11.000000000 +0400 @@ -7,6 +7,7 @@ PORTNAME= igmpproxy PORTVERSION= 0.1 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} >Release-Note: >Audit-Trail: >Unformatted: