permissions of /proc/tty/driver
Quoted 5 lines · Thomas Viehmann
Hi.
This may not be stritly on topic, but I couln't figure out a better place to ask:
Quoted 10 lines
During the packaging of an application, I have the following problem:
I would like to run a daemon as non-root. The daemon likes to (continually) check/proc/tty/driver/usbserialto see whether or not interesting USB devices are connected. The permissions of this actual file is (on a kernel compiled from Debian's kernel-source-2.6.10) 0444, so this isn't a problem. However, the parent directory/proc/tty/driveris 0500. I'm not sure whether this is related to Debian DSAs 358 or 423 (where/proc/tty/driver/serialis mentioned as leaking sensitive information), to me the contents of usbserial look innocent enough. Do you have any hints on what might be a good solution?
The permissions on the directory look indeed too strict to me. It might be better to just use strict permissions on /proc/tty/driver/serial indeed.
Counter-question: What information is available in /proc/tty/driver/usbserial but not in sysfs?
Hi.
Quoted 2 lines · Christoph Hellwig
Counter-question: What information is available in
/proc/tty/driver/usbserialbut not in sysfs?
Thanks for this hint, is there a way of finding vendor and product ids of all ttyUSB devices better than looking for /sys/bus/usb/devices/*-*/*-*:*/ttyUSB* and then ckecking the obvious files in the grandparent directory?
Kind regards
Thomas
Signature · 1 line
Thomas Viehmann, <http://thomas.viehmann.net/>
Quoted 8 lines · Thomas Viehmann
Quoted 2 lines · Christoph Hellwig
Counter-question: What information is available in
/proc/tty/driver/usbserialbut not in sysfs?Thanks for this hint, is there a way of finding vendor and product ids of all ttyUSB devices better than
looking for /sys/bus/usb/devices/*-*/*-*:*/ttyUSB* and then ckecking the obvious files in the grandparent directory?
/sys/bus/usb-serial/devices/* looks like what you need...
Quoted 7 lines · Christoph Hellwig
Quoted 3 lines
(where
/proc/tty/driver/serialis mentioned as leaking sensitive information), to me the contents of usbserial look innocent enough. Do you have any hints on what might be a good solution?The permissions on the directory look indeed too strict to me. It might be better to just use strict permissions on
/proc/tty/driver/serialindeed.
The file containts transmit and receive byte counts, which means you can both measure intercharacter delay and character count. Thats a big help to password guessers
Quoted 5 lines · Alan Cox
Quoted 4 lines · Christoph Hellwig
Quoted 3 lines
(where
/proc/tty/driver/serialis mentioned as leaking sensitive information), to me the contents of usbserial look innocent enough. Do you have any hints on what might be a good solution?
Quoted 7 lines
Quoted 3 lines
The permissions on the directory look indeed too strict to me. It might be better to just use strict permissions on
/proc/tty/driver/serialindeed.The file containts transmit and receive byte counts, which means you can both measure intercharacter delay and character count. Thats a big help to password guessers
I know. But that doesn't explain why we don't keep strict permissions only on that file but on the directory.
Quoted 10 lines · Christoph Hellwig
Quoted 9 lines · Alan Cox
Quoted 7 lines · Christoph Hellwig
Quoted 3 lines
(where
/proc/tty/driver/serialis mentioned as leaking sensitive information), to me the contents of usbserial look innocent enough. Do you have any hints on what might be a good solution?The permissions on the directory look indeed too strict to me. It might be better to just use strict permissions on
/proc/tty/driver/serialindeed.
Quoted 6 lines
Quoted 3 lines
The file containts transmit and receive byte counts, which means you can both measure intercharacter delay and character count. Thats a big help to password guessers
I know. But that doesn't explain why we don't keep strict permissions only on that file but on the directory.
ls -la on the file gives you the size maybe ?
Quoted 5 lines · Arjan van de Ven
Quoted 2 lines · Christoph Hellwig
I know. But that doesn't explain why we don't keep strict permissions only on that file but on the directory.
ls -la on the file gives you the size maybe ?
I went for a dig in the archives
The original fix removed the tx/rx data from the file if you weren't priviledged. Linus did the directory hack because he didn't want to worry about drivers that got missed out/not fixed.
So there's a janitor project there - to go through all the tty/serial drivers and make sure they don't give out excessively useful information to non CAP_SYS_RAWIO users, then loosen permissions.
Quoted 10 lines · Thomas Viehmann
Hi.
Quoted 2 lines · Christoph Hellwig
Counter-question: What information is available in
/proc/tty/driver/usbserialbut not in sysfs?Thanks for this hint, is there a way of finding vendor and product ids of all ttyUSB devices better than
looking for /sys/bus/usb/devices/*-*/*-*:*/ttyUSB* and then ckecking the obvious files in the grandparent directory?
I think that's the obvious way. Using libsysfs will make your life much easier when doing that, though.