From owner-cvs-all Fri Nov 30 11:57:22 2001 Delivered-To: cvs-all@freebsd.org Received: from noos.fr (r178m112.cybercable.tm.fr [195.132.178.112]) by hub.freebsd.org (Postfix) with ESMTP id EC03F37B419; Fri, 30 Nov 2001 11:57:15 -0800 (PST) Received: (from mux@localhost) by noos.fr (8.11.6/8.11.4) id fAUJvII00362; Fri, 30 Nov 2001 20:57:18 +0100 (CET) (envelope-from mux) Date: Fri, 30 Nov 2001 20:57:18 +0100 From: Maxime Henrion To: cvs-all@FreeBSD.org Cc: Ruslan Ermilov Subject: Re: cvs commit: src/sys/netinet icmp_var.h ip_icmp.c ip_input.c ip_var.h src/usr.bin/netstat inet.c Message-ID: <20011130205718.A275@nebula.noos.fr> References: <200111301040.fAUAeS519148@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="mP3DRpeJDSE+ciuQ" Content-Disposition: inline In-Reply-To: <200111301040.fAUAeS519148@freefall.freebsd.org> User-Agent: Mutt/1.3.23i Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Ruslan Ermilov wrote: > ru 2001/11/30 02:40:28 PST > > Modified files: > sys/netinet icmp_var.h ip_icmp.c ip_input.c ip_var.h > usr.bin/netstat inet.c [...] This commit appears to break the kernel. In some cases, icmp_reflect() calls icmp_send() with a NULL pointer for the struct route * parameter. icmp_send() then pass it to ip_output() which dereferences it. I've had several panics like this at boot, and also got some lockups for reasons I ignore. :-) It seems to me that in the icmp_reflect() code it is intentional to call icmp_send() with a NULL pointer, so I did a little patch that use a struct route bzero'ed in that case in icmp_send() as it was in revision 1.63. It probably isn't a correct patch but at least it solved the problem. Thanks, Maxime Henrion -- Don't be fooled by cheap finnish imitations ; BSD is the One True Code --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ip_icmp.diff" Index: ip_icmp.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_icmp.c,v retrieving revision 1.64 diff -u -r1.64 ip_icmp.c --- ip_icmp.c 30 Nov 2001 10:40:27 -0000 1.64 +++ ip_icmp.c 30 Nov 2001 19:48:41 -0000 @@ -728,6 +728,7 @@ register struct ip *ip = mtod(m, struct ip *); register int hlen; register struct icmp *icp; + struct route ro; hlen = IP_VHL_HL(ip->ip_vhl) << 2; m->m_data += hlen; @@ -746,6 +747,10 @@ buf, inet_ntoa(ip->ip_src)); } #endif + if (rt == NULL) { + bzero(&ro, sizeof (ro)); + rt = &ro; + } (void) ip_output(m, opts, rt, 0, NULL); } --mP3DRpeJDSE+ciuQ-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message