From owner-freebsd-bugs@FreeBSD.ORG Mon Apr 17 18:50:14 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3424516A407 for ; Mon, 17 Apr 2006 18:50:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E83243D55 for ; Mon, 17 Apr 2006 18:50:12 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k3HIoCWh072396 for ; Mon, 17 Apr 2006 18:50:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k3HIoCF5072395; Mon, 17 Apr 2006 18:50:12 GMT (envelope-from gnats) Resent-Date: Mon, 17 Apr 2006 18:50:12 GMT Resent-Message-Id: <200604171850.k3HIoCF5072395@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, James Juran Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D67A216A400 for ; Mon, 17 Apr 2006 18:43:05 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B69A43D73 for ; Mon, 17 Apr 2006 18:43:04 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k3HIh4sb017543 for ; Mon, 17 Apr 2006 18:43:04 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k3HIh4Qq017542; Mon, 17 Apr 2006 18:43:04 GMT (envelope-from nobody) Message-Id: <200604171843.k3HIh4Qq017542@www.freebsd.org> Date: Mon, 17 Apr 2006 18:43:04 GMT From: James Juran To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: kern/95957: missing check for failed memory alloc in icmp6_input() X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Apr 2006 18:50:14 -0000 >Number: 95957 >Category: kern >Synopsis: missing check for failed memory alloc in icmp6_input() >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Apr 17 18:50:11 GMT 2006 >Closed-Date: >Last-Modified: >Originator: James Juran >Release: 7.0-CURRENT >Organization: BAE Systems Inc. >Environment: N/A >Description: It appears that the processing of the ICMP6_WRUREQUEST message in icmp6_input is missing a check for a failed memory allocation from MGETHDR(M_DONTWAIT). The mbuf allocated by MGETHDR() is passed to m_dup_pkthdr() without first verifying that it is non-NULL, and m_dup_pkthdr() references through its first argument, also without verifying that it is non-NULL. So if this allocation fails we will get a kernel panic in m_dup_pkthdr(). >How-To-Repeat: code inspection >Fix: Change if (!m_dup_pkthdr(n, m, M_DONTWAIT)) { to if (n && !m_dup_pkthdr(n, m, M_DONTWAIT)) { at line 686 of icmp6.c. >Release-Note: >Audit-Trail: >Unformatted: