Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Nov 2008 13:02:57 +0100
From:      Rink Springer <rink@FreeBSD.org>
To:        usb@FreeBSD.org
Subject:   Patch to convert usb2 to use cdev
Message-ID:  <20081109120257.GA78524@rink.nu>

next in thread | raw e-mail | index | archive | help
Hi everyone,

I've made a patch, available at http://rink.nu/tmp/usb-cdev.diff, which
removes the custom "/dev/usb " device, associated event handlers and
custom ownership/permissions structures and converts the whole deal to
use make_dev(9) and friends. The end result is that every USB device
will get a /dev entry, which can be chmod(1)-ed, chown(1)-ed etc as
usual - futhermore, possible races between looking up a device name and
opening it are completely removed by this patch [1]

usbconfig(8) works as before after applying the patch, but obviously,
commands that involve setting permissions or ownership will return an
error as those ioctl's are no longer present; I intend to remove them
completely and from usbconfig itself after this patch has been
committed.

Feel free to review this patch; I'd like to commit it to HEAD at the end
of the week or so.

[1] The previous code would set a global variable to determine which
    USB device corresponds with the file being looked up, and a
    subsequent open call would open this device. I don't know the VFS
    well enough to determine if this can be exploited, but it doesn't
    look right to me :-)

Regards,

-- 
Rink P.W. Springer                                - http://rink.nu
"Anyway boys, this is America. Just because you get more votes doesn't
 mean you win." - Fox Mulder



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