Subject: kern/10663: incorrect check for MCLGET error return in ip_fil.c
To: None <gnats-bugs@gnats.netbsd.org>
From: None <sommerfeld@orchard.arlington.ma.us>
List: netbsd-bugs
Date: 07/23/2000 21:15:12
>Number:         10663
>Category:       kern
>Synopsis:       incorrect check for MCLGET error return in ip_fil.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 23 21:16:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Bill Sommerfeld
>Release:        20000720ish
>Organization:
	
>Environment:
	
System: NetBSD orchard.arlington.ma.us 1.4.1 NetBSD 1.4.1 (ORCHARDII) #60: Sat Oct 9 22:18:23 EDT 1999 root@:/usr/src/sys/arch/i386/compile/ORCHARDII i386


>Description:

/*	$NetBSD: ip_fil.c,v 1.55 2000/06/12 10:41:36 veego Exp $	*/

currently, in send_icmp_err(), ip_fil.c checks for MCLGET() failure
incorrectly; it does a:

		MCLGET(m, M_DONTWAIT);
		if (!m)
			return ENOBUFS;

when it should do:

		MCLGET(m, M_DONTWAIT);
		if ((m->m_flags & M_EXT) == 0) {
			m_freem(m);
			return ENOBUFS;
		}

See every other invocation of MCLGET(m, M_DONTWAIT) in the kernel...

>How-To-Repeat:
	detected by inspection; not encountered in practice.

>Fix:
	see above.
>Release-Note:
>Audit-Trail:
>Unformatted: