NetBSD Problem Report #3122
Received: (qmail-queue invoked from smtpd); 17 Jan 1997 18:08:18 -0000
Message-Id: <199701171729.SAA00247@zelz26.zel.kfa-juelich.de>
Date: Fri, 17 Jan 1997 18:29:02 +0100 (MET)
From: Matthias Drochner <drochner@zelz26.zel.kfa-juelich.de>
Reply-To: drochner@zelux6.zel.kfa-juelich.de
To: gnats-bugs@gnats.netbsd.org
Subject: bad error handling in libsa/open.c
X-Send-Pr-Version: 3.95
>Number: 3122
>Category: kern
>Synopsis: NULL pointer dereference on open error in F_NODEV case
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jan 17 10:20:05 +0000 1997
>Closed-Date: Fri Jan 17 20:03:59 +0000 1997
>Last-Modified: Fri Jan 17 20:04:27 +0000 1997
>Originator: Matthias Drochner
>Release: current
>Organization:
KFA Juelich
>Environment:
NetBSD-current / libsa
System: NetBSD zelz26 1.2 NetBSD 1.2 (TULIP) #21: Thu Nov 14 22:05:19 MET 1996 drochner@zelz28:/home/drochner/netbsd/sys/arch/i386/compile/TULIP i386
>Description:
If an error occurs in the filesystem open function, and the F_NODEV
flag was set in devopen(), a NULL pointer will be called.
(devopen() is obviously not supposed to set the f_dev field in the F_NODEV case.
Compare with close() which does even more checks than necessary!)
>How-To-Repeat:
???
>Fix:
*** 119,125 ****
if (!error)
error = ENOENT;
! f->f_dev->dv_close(f);
err:
f->f_flags = 0;
errno = error;
--- 119,126 ----
if (!error)
error = ENOENT;
! if(!(f->f_flags & F_NODEV))
! f->f_dev->dv_close(f);
err:
f->f_flags = 0;
errno = error;
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: cgd
State-Changed-When: Fri Jan 17 12:03:59 PST 1997
State-Changed-Why:
similar fix applies.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.