Skip to contentSkip to conversation

permissions of /proc/tty/driver

DISCUSSION Christoph Hellwig 5 participants 8 messages Jan 16, 2005 – Jan 19, 2005 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
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/usbserial to 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/driver is 0500. I'm not sure whether this is related to Debian DSAs 358 or 423 (where /proc/tty/driver/serial is 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?

#2 lore raw

Hi.

Quoted 2 lines · Christoph Hellwig

Counter-question: What information is available in /proc/tty/driver/usbserial but 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/>
#3 lore raw
Quoted 8 lines · Thomas Viehmann
Quoted 2 lines · Christoph Hellwig

Counter-question: What information is available in /proc/tty/driver/usbserial but 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...

#4 lore raw
In reply to Thomas Viehmann
Quoted 10 lines · Thomas Viehmann

Hi.

Quoted 2 lines · Christoph Hellwig

Counter-question: What information is available in /proc/tty/driver/usbserial but 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.

#5 lore raw
In reply to Christoph Hellwig
Quoted 7 lines · Christoph Hellwig
Quoted 3 lines

(where /proc/tty/driver/serial is 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.

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

#6 lore raw
Quoted 5 lines · Alan Cox
Quoted 4 lines · Christoph Hellwig
Quoted 3 lines

(where /proc/tty/driver/serial is 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/serial indeed.

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.

#7 lore raw
Quoted 10 lines · Christoph Hellwig
Quoted 9 lines · Alan Cox
Quoted 7 lines · Christoph Hellwig
Quoted 3 lines

(where /proc/tty/driver/serial is 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.

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 ?

#8 lore raw
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.