From owner-freebsd-bugs Sat Sep 8 13:30: 6 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 28D5E37B403 for ; Sat, 8 Sep 2001 13:30:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f88KU1i47152; Sat, 8 Sep 2001 13:30:01 -0700 (PDT) (envelope-from gnats) Received: from gatekeeper.gate5.de (gatekeeper.gate5.de [212.84.193.254]) by hub.freebsd.org (Postfix) with ESMTP id 679B237B409 for ; Sat, 8 Sep 2001 13:20:53 -0700 (PDT) Received: (from cc@localhost) by gatekeeper.gate5.de (8.11.6/8.11.4) id f88KKak01433; Sat, 8 Sep 2001 22:20:36 +0200 (CEST) (envelope-from cc) Message-Id: <200109082020.f88KKak01433@gatekeeper.gate5.de> Date: Sat, 8 Sep 2001 22:20:36 +0200 (CEST) From: Christian Carstensen Reply-To: Christian Carstensen To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: kern/30440: possible null pointer deref in bpfdetach() Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 30440 >Category: kern >Synopsis: possible null pointer deref in bpfdetach() >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Sep 08 13:30:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Christian Carstensen >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: System: FreeBSD albert.gate5.de 5.0-CURRENT FreeBSD 5.0-CURRENT #25: Thu Sep 6 04:20:50 CEST 2001 root@albert.gate5.de:/usr/src/sys/i386/compile/ALBERT i386 >Description: in net/bpf.c, bpfdetach(), stuct bpf_if *bp is used in a for loop, that, if not terminated by break before, leaves bp == NULL. evaluating (bp->bif_ifp == NULL) two lines later will cause a NULL pointer dereference, resulting in trap 12. >How-To-Repeat: just call bpfdetach(ifp) with any ifp that has no bpf interface attached. >Fix: RCS file: /usr/cvs/src/sys/net/bpf.c,v retrieving revision 1.80 diff -r1.80 bpf.c 1267c1267 < if (bp->bif_ifp == NULL) { --- > if (bp == NULL || bp->bif_ifp == NULL) { >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message