Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Dec 2004 19:48:05 GMT
From:      Christoph Mallon <christoph.mallon@gmx.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/75233: breaking fdformat /dev/fd0 resets device permissions and perhaps causes unkillable process
Message-ID:  <200412181948.iBIJm5qo062504@www.freebsd.org>
Resent-Message-ID: <200412181950.iBIJoVeK087588@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         75233
>Category:       kern
>Synopsis:       breaking fdformat /dev/fd0 resets device permissions and perhaps causes unkillable process
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 18 19:50:30 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Christoph Mallon
>Release:        FreeBSD 6.0-CURRENT
>Organization:
>Environment:
FreeBSD tron.homeunix.org 6.0-CURRENT FreeBSD 6.0-CURRENT #1: Wed Dec 15 10:19:30 CET 2004     root@tron.homeunix.org:/usr/obj/usr/src/sys/KERNEL  i386
>Description:
I formated a bunch of 3.5" floppies the other day to check which have bad sectors. Every time I heard the typical bad sector sound from the floppy i stopped fdformat with ^C, after several disks this happend:
%fdformat -y /dev/fd0
Processing VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^C
[put in next disk]
%fdformat -y /dev/fd0
fdformat: open(/dev/fd0): Permission denied
%ls -l /dev/fd0
crw-r-----  1 root  operator  232,   0 16 Dez 21:41 /dev/fd0
%tail -1 /etc/devfs.conf
perm    fd0     0660

As you can see i set the permissions for fd0 to 660 in devfs.conf and suddenly they got reset to 640.
/dev/console didn't show anything related to this.

I set the permission back to 660 by hand and continued. A bit later this happend again and I set the permissions to 660 again.
After that the following happend:
%fdformat -y /dev/fd0
[floppy motor spins up]
[hang for several minutes without any output]
^C
[no reaction]

top on another terminal showed me this:
75741 tron      76    0  1284K   536K GEOM t   0:00  0.00%  0.00% fdformat

The process didn't react on kill -KILL.
The floppy motor was still on.
I tried to shut down my box (shutdown -h now) with the following result:
[usual output]
init: some processes would not die; ps axl advised
[usual output]
All buffers synced
[no more output]

Then the machine just hang without the usual uptime and "press any key to reboot" message while the floppy motor was still on.
>How-To-Repeat:
1. chmod 660 /dev/fd0
2. fdformat /dev/fd0
3. break via ^C (not sure if a disk with bad sectors is necessary, probably not)
4. ls -l /dev/fd0
doesn't happen always, repeat 2-4 until it happens

The problem with the unkillable process appeared only once and I didn't try to reproduce it, but i guess it happens after several iterations of setting the permissions back to proper values and continuing with fdformat.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200412181948.iBIJm5qo062504>