From owner-freebsd-stable Tue Mar 11 10:42:13 2003 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 43B1437B401 for ; Tue, 11 Mar 2003 10:42:11 -0800 (PST) Received: from mail.sandvine.com (sandvine.com [199.243.201.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id 91C2843F85 for ; Tue, 11 Mar 2003 10:42:10 -0800 (PST) (envelope-from don@sandvine.com) Received: by mail.sandvine.com with Internet Mail Service (5.5.2653.19) id ; Tue, 11 Mar 2003 13:42:10 -0500 Message-ID: From: Don Bowman To: "'freebsd-stable@freebsd.org'" Subject: missing splx(s) in if_ethersubcr.c Date: Tue, 11 Mar 2003 13:42:09 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG It seems there is a missing trio of 'splx' in error cases in if_ethersubr.c for 4.7 RELEASE. (pr submitted as well). Index: /src/sys/net/if_ethersubr.c =================================================================== RCS file: /usr/cvs/src/sys/net/if_ethersubr.c,v retrieving revision 1.70.2.30 diff -c -5 -r1.70.2.30 if_ethersubr.c *** /src/sys/net/if_ethersubr.c 2 Jan 2003 18:07:51 -0000 1.70.2.30 --- /src/sys/net/if_ethersubr.c 11 Mar 2003 16:55:08 -0000 *************** *** 412,434 **** save_eh = *eh; m_adj(m, ETHER_HDR_LEN); if (ether_ipfw_chk(&m, ifp, &rule, eh, 0) == 0) { if (m) { m_freem(m); return ENOBUFS; /* pkt dropped */ ! } else return 0; /* consumed e.g. in a pipe */ } /* packet was ok, restore the ethernet header */ if ( (void *)(eh + 1) == (void *)m->m_data) { m->m_data -= ETHER_HDR_LEN ; m->m_len += ETHER_HDR_LEN ; m->m_pkthdr.len += ETHER_HDR_LEN ; } else { M_PREPEND(m, ETHER_HDR_LEN, M_DONTWAIT); if (m == NULL) /* nope... */ ! return ENOBUFS; bcopy(&save_eh, mtod(m, struct ether_header *), ETHER_HDR_LEN); } } --- 412,440 ---- save_eh = *eh; m_adj(m, ETHER_HDR_LEN); if (ether_ipfw_chk(&m, ifp, &rule, eh, 0) == 0) { if (m) { m_freem(m); + splx(s); return ENOBUFS; /* pkt dropped */ ! } else { ! splx(s); return 0; /* consumed e.g. in a pipe */ + } } /* packet was ok, restore the ethernet header */ if ( (void *)(eh + 1) == (void *)m->m_data) { m->m_data -= ETHER_HDR_LEN ; m->m_len += ETHER_HDR_LEN ; m->m_pkthdr.len += ETHER_HDR_LEN ; } else { M_PREPEND(m, ETHER_HDR_LEN, M_DONTWAIT); if (m == NULL) /* nope... */ ! { ! splx(s); ! return ENOBUFS; ! } bcopy(&save_eh, mtod(m, struct ether_header *), ETHER_HDR_LEN); } } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message