NetBSD Problem Report #52828

From www@NetBSD.org  Sat Dec 16 20:52:46 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id D13397A17D
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 16 Dec 2017 20:52:45 +0000 (UTC)
Message-Id: <20171216205242.A0B117A1E2@mollari.NetBSD.org>
Date: Sat, 16 Dec 2017 20:52:42 +0000 (UTC)
From: markj@FreeBSD.org
Reply-To: markj@FreeBSD.org
To: gnats-bugs@NetBSD.org
Subject: makefs UFS2 lazy inode initialization is buggy
X-Send-Pr-Version: www-1.0

>Number:         52828
>Category:       bin
>Synopsis:       makefs UFS2 lazy inode initialization is buggy
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 16 20:55:00 +0000 2017
>Closed-Date:    Thu Jun 14 22:33:47 +0000 2018
>Last-Modified:  Thu Jun 14 22:33:47 +0000 2018
>Originator:     Mark Johnston
>Release:        
>Organization:
>Environment:
>Description:
makefs(8) emulates UFS2 in performing lazy initialization of inode blocks when allocating and writing inodes. However, it only ever initializes one inode block at a time, which may be insufficient. If so, a later initialization may clobber an inode, resulting in an inconsistent filesystem.
>How-To-Repeat:
Not sure. I hit the issue while building VM images from a FreeBSD src tree. I hit a panic in FFS, and later discovered that makefs was generating filesystems containing inconsistencies (according to fsck_ffs).
>Fix:
I committed a minimal fix for the problem to FreeBSD: https://svnweb.freebsd.org/changeset/base/326912

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52828 CVS commit: src/usr.sbin/makefs
Date: Sat, 16 Dec 2017 18:08:40 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Sat Dec 16 23:08:40 UTC 2017

 Modified Files:
 	src/usr.sbin/makefs: ffs.c

 Log Message:
 PR/52828: Mark Johnston: makefs UFS2 lazy inode initialization is buggy

 makefs(8) emulates UFS2 in performing lazy initialization of inode
 blocks when allocating and writing inodes. However, it only ever
 initializes one inode block at a time, which may be insufficient.
 If so, a later initialization may clobber an inode, resulting in
 an inconsistent filesystem.

 I committed a minimal fix for the problem to FreeBSD:
 https://svnweb.freebsd.org/changeset/base/326912


 To generate a diff of this commit:
 cvs rdiff -u -r1.69 -r1.70 src/usr.sbin/makefs/ffs.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->pending-pullups
State-Changed-By: maya@NetBSD.org
State-Changed-When: Mon, 04 Jun 2018 11:30:12 +0000
State-Changed-Why:
pullup-8 858, pullup-7 1615


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52828 CVS commit: [netbsd-7] src/usr.sbin/makefs
Date: Wed, 6 Jun 2018 15:49:02 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Wed Jun  6 15:49:02 UTC 2018

 Modified Files:
 	src/usr.sbin/makefs [netbsd-7]: ffs.c

 Log Message:
 Pull up following revision(s) (requested by maya in ticket #1615):

 	usr.sbin/makefs/ffs.c: revision 1.70

 PR/52828: Mark Johnston: makefs UFS2 lazy inode initialization is buggy
 makefs(8) emulates UFS2 in performing lazy initialization of inode
 blocks when allocating and writing inodes. However, it only ever
 initializes one inode block at a time, which may be insufficient.

 If so, a later initialization may clobber an inode, resulting in
 an inconsistent filesystem.

 I committed a minimal fix for the problem to FreeBSD:
 https://svnweb.freebsd.org/changeset/base/326912


 To generate a diff of this commit:
 cvs rdiff -u -r1.63.6.1 -r1.63.6.2 src/usr.sbin/makefs/ffs.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52828 CVS commit: [netbsd-8] src/usr.sbin/makefs
Date: Sat, 9 Jun 2018 14:35:21 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat Jun  9 14:35:21 UTC 2018

 Modified Files:
 	src/usr.sbin/makefs [netbsd-8]: ffs.c

 Log Message:
 Pull up following revision(s) (requested by maya in ticket #858):

 	usr.sbin/makefs/ffs.c: revision 1.70

 PR/52828: Mark Johnston: makefs UFS2 lazy inode initialization is buggy
 makefs(8) emulates UFS2 in performing lazy initialization of inode
 blocks when allocating and writing inodes. However, it only ever
 initializes one inode block at a time, which may be insufficient.

 If so, a later initialization may clobber an inode, resulting in
 an inconsistent filesystem.

 I committed a minimal fix for the problem to FreeBSD:
 https://svnweb.freebsd.org/changeset/base/326912


 To generate a diff of this commit:
 cvs rdiff -u -r1.69 -r1.69.4.1 src/usr.sbin/makefs/ffs.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52828 CVS commit: [netbsd-7-1] src/usr.sbin/makefs
Date: Thu, 14 Jun 2018 19:40:07 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Thu Jun 14 19:40:07 UTC 2018

 Modified Files:
 	src/usr.sbin/makefs [netbsd-7-1]: ffs.c

 Log Message:
 Pull up following revision(s) (requested by maya in ticket #1615):

 	usr.sbin/makefs/ffs.c: revision 1.70

 PR/52828: Mark Johnston: makefs UFS2 lazy inode initialization is buggy
 makefs(8) emulates UFS2 in performing lazy initialization of inode
 blocks when allocating and writing inodes. However, it only ever
 initializes one inode block at a time, which may be insufficient.

 If so, a later initialization may clobber an inode, resulting in
 an inconsistent filesystem.

 I committed a minimal fix for the problem to FreeBSD:
 https://svnweb.freebsd.org/changeset/base/326912


 To generate a diff of this commit:
 cvs rdiff -u -r1.63.6.1 -r1.63.6.1.6.1 src/usr.sbin/makefs/ffs.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52828 CVS commit: [netbsd-7-0] src/usr.sbin/makefs
Date: Thu, 14 Jun 2018 19:40:38 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Thu Jun 14 19:40:38 UTC 2018

 Modified Files:
 	src/usr.sbin/makefs [netbsd-7-0]: ffs.c

 Log Message:
 Pull up following revision(s) (requested by maya in ticket #1615):

 	usr.sbin/makefs/ffs.c: revision 1.70

 PR/52828: Mark Johnston: makefs UFS2 lazy inode initialization is buggy
 makefs(8) emulates UFS2 in performing lazy initialization of inode
 blocks when allocating and writing inodes. However, it only ever
 initializes one inode block at a time, which may be insufficient.

 If so, a later initialization may clobber an inode, resulting in
 an inconsistent filesystem.

 I committed a minimal fix for the problem to FreeBSD:
 https://svnweb.freebsd.org/changeset/base/326912


 To generate a diff of this commit:
 cvs rdiff -u -r1.63.6.1 -r1.63.6.1.2.1 src/usr.sbin/makefs/ffs.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Thu, 14 Jun 2018 22:33:47 +0000
State-Changed-Why:
Pullups done. Thanks for the patch.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.