Re: [PATCH 1/2] char/mem: Add /dev/io (v2)

From: Adam Jackson
Date: Tue Feb 07 2012 - 19:38:58 EST

On 2/7/12 7:17 PM, Alan Cox wrote:
On Tue, 7 Feb 2012 18:39:45 -0500
Adam Jackson<ajax@xxxxxxxxxx> wrote:

This is like /dev/port except not broken. /dev/port will translate all
read/write into inb/outb streams, which is wrong since hardware can and
does care about cycle size. /dev/io will only allow 1, 2, or 4 byte
access, and will translate that into the appropriate bus cycle size.

From a security perspective /dev/[k][mem is a dumb bit of ancient Unix
history we'd dearly like to kill off. /dev/port is a similar early PC
unixism that wants to go the same way. /dev/io just adds another horror
to the pile.

Please do the decent thing, stop using /dev/mem and /dev/port for
anything. If you need to access an I/O device make it properly visible
via the kernel only for the ports and in a manner that is safe.

Yeah, I'll be sure to do that right as soon as I can stop supporting the vesa driver. Until that time I don't really have any choice but to expose the whole of I/O port space, since I have no idea what the video BIOS is going to touch.

I don't disagree with wanting to limit access to these services, but /dev/io is at least somewhat containable, whereas iopl is insane.

- ajax

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at