Subject: kern/9034: can write to a mounted ro msdos disk
To: None <gnats-bugs@gnats.netbsd.org>
From: Shane Hutchison <shutchis@amarok.eyring.com>
List: netbsd-bugs
Date: 12/20/1999 11:48:39
>Number:         9034
>Category:       kern
>Synopsis:       can write to a mounted ro msdos disk
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 20 11:48:01 1999
>Last-Modified:
>Originator:     Shane Hutchison
>Organization:
	
>Release:        NetBSD-1.4.1
>Environment:
	i386, NetBSD, 
System: NetBSD amarok.eyring.com 1.4.1 NetBSD 1.4.1 (AMAROK) #1: Mon Dec 13 12:08:25 MST 1999 root@amarok.eyring.com:/usr/src/sys/arch/i386/compile/AMAROK i386


>Description:
- quoted material -
	amarok-~/pdos/4/binaries/special/floppy$ tar -czf 3580-264.tar.tz *
amarok-~/pdos/4/binaries/special/floppy$ ls
3580-2~1.tz  fbiosw.sr  fparm.sr  mibiosu.sr  readme
f32parm.sr   ffrmt.sr   mfrmt.sr  miparm.sr   wfc1.sr

amarok-~/pdos/4/binaries/special$ mount
/dev/wd0a on / type ffs (local)
/dev/wd0e on /usr type ffs (local)
/dev/wd0f on /var type ffs (local)
/dev/wd0g on /tmp type ffs (local)
kernfs on /kern type kernfs (local)
/dev/fd0a on /usr/home/shutchis/pdos/4/binaries/special/floppy type msdos (local, nodev, nosuid, read-only, mounted by shutchis)

- submitters' notes -
When mistakenly denoting the wrong location to create the above mentioned 3580-264.tar.gz (written as .tar.tz), the file was created on the mounted HD floppy which was mounted only as read-only.  Worthy of note is that the file created (besides ofcourse being a lfn, had 0 bytes of information - thus the filename was written to the otherwise read-only disk but no actual information was written.

           
>How-To-Repeat:
	amarokbash-2.03# mount -t msdos -o ro /dev/fd0a /mnt      
        amarokbash-2.03# echo something > /mnt/file

	amarokbash-2.03# ls /mnt
	file
	amarokbash-2.03# ll /mnt
	total 1
	-rwxr-xr-x  1 root  wheel  10 Dec 20 12:29 file
	amarokbash-2.03# umount /mnt

(note:  when checking floppy on MSDOS computer "file" showed as zero (0) bytes)


>Fix:
	
>Audit-Trail:
>Unformatted: