Subject: Re: bin/36229: uninitialized dkwedge_info structure in mount_mfs
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,>
From: Geoff Wing <gcw@pobox.com>
List: netbsd-bugs
Date: 04/27/2007 22:00:07
The following reply was made to PR bin/36229; it has been noted by GNATS.
From: Geoff Wing <gcw@pobox.com>
To: Christos Zoulas <christos@zoulas.com>
Cc: gnats-bugs@NetBSD.org
Subject: Re: bin/36229: uninitialized dkwedge_info structure in mount_mfs
causes random failures
Date: Sat, 28 Apr 2007 07:55:02 +1000
On Friday 2007-04-27 14:40 +0000, Christos Zoulas output:
: |
: | --- sbin/newfs/newfs.c.org 2006-11-26 19:39:17.000000000 +1100
: | +++ sbin/newfs/newfs.c 2007-04-27 15:20:23.000000000 +1000
: | @@ -425,6 +425,7 @@
: | usage();
: |
: | memset(&sb, 0, sizeof sb);
: | + memset(&dkw, 0, sizeof dkw);
: | special = argv[0];
: | if (Fflag || mfs) {
: | /*
:
: I don't understand this. If getdiskinfo succeeds, dkw should be properly
: initialized; if it fails then we exit.
If we're called as mount_mfs (or with -F) then we take the pathway at
line 429 (see snippet above) and never call getdiskinfo() but later, at
line 548, we access dkw:
if (dkw.dkw_parent[0] && fssize > dkw.dkw_size)
which is uninitialized.
Regards,
Geoff