Date: Mon, 25 Aug 2003 13:00:40 -0700 (PDT) From: Robert Watson <rwatson@FreeBSD.org> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/55886: mbuf exhaustion can cause panic Message-ID: <200308252000.h7PK0evT050369@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/55886; it has been noted by GNATS. From: Robert Watson <rwatson@FreeBSD.org> To: Pawel Malachowski <pawmal-posting@freebsd.lublin.pl> Cc: FreeBSD-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org Subject: Re: kern/55886: mbuf exhaustion can cause panic Date: Mon, 25 Aug 2003 15:52:46 -0400 (EDT) Try the attached patch for -CURRENT, or variation on -STABLE. Basically, M_PREPEND() can fail leaving (m == NULL) even with M_TRYWAIT. Most consumers of M_PREPEND seem to know that. Raw IP output seems not to. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories Index: raw_ip.c =================================================================== RCS file: /data/fbsd-cvs/ncvs/src/sys/netinet/raw_ip.c,v retrieving revision 1.114 diff -u -r1.114 raw_ip.c --- raw_ip.c 20 Aug 2003 14:46:40 -0000 1.114 +++ raw_ip.c 25 Aug 2003 19:50:07 -0000 @@ -288,6 +288,8 @@ return(EMSGSIZE); } M_PREPEND(m, sizeof(struct ip), M_TRYWAIT); + if (m == NULL) + return(ENOBUFS); ip = mtod(m, struct ip *); ip->ip_tos = inp->inp_ip_tos; ip->ip_off = 0;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308252000.h7PK0evT050369>