Subject: kern/29898: mount(2) can corrupt filesystem
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <yamt@mwd.biglobe.ne.jp>
List: netbsd-bugs
Date: 04/06/2005 04:30:00
>Number: 29898
>Category: kern
>Synopsis: mount(2) can corrupt filesystem
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Apr 06 04:30:00 +0000 2005
>Originator: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
>Release: NetBSD 3.99.3
>Organization:
>Environment:
System: NetBSD kaeru 3.99.3 NetBSD 3.99.3 (build.kaeru.nodebug) #35: Tue Apr 5 15:52:06 JST 2005 takashi@kaeru:/home/takashi/work/kernel/build.kaeru.nodebug i386
Architecture: i386
Machine: i386
>Description:
as mount(2) temporarily alters important mnt_flag like MNT_SOFTDEP,
if there're other activities on the filesystem in the mean time,
you'll lose. in the worst case, it ends up corrupting the filesystem.
mount(2) with MNT_GETARGS is esp. harmful because it can be done
by arbitrary users.
>How-To-Repeat:
code inspection.
>Fix:
restructure mount related code so that the caller of
VFS_MOUNT doesn't need to alter mnt_flag/iflag.
maybe by adding more arguments to VFS_MOUNT to describe the operation.
>Unformatted: