Re: [kernel-hardening] Re: [PATCH] proc: restrict access to/proc/interrupts

From: Greg KH
Date: Mon Nov 07 2011 - 18:45:52 EST


On Mon, Nov 07, 2011 at 06:40:13PM -0500, Theodore Tso wrote:
>
> On Nov 7, 2011, at 6:27 PM, Greg KH wrote:
> >
> > So, what do we really need revoke() for these days?
>
> As I mentioned at the kernel summit, I'd like revoke along with a
> formal notification from block devices that get ejected to the file
> system layer, and the file system should be able to call a VFS library
> function which revokes all open file descriptor on the ejected block
> device. It would result in much cleaner handling at the file system
> level when a USB storage device gets pulled.

So you want revoke() on a block device to do what? The same thing as
disconnecting it from the hardware level?

> > But that's getting away from the original topic here, sorryâ
>
> Yup. But if revoke has come up, I'd like to remind folks that there
> are good uses of it besides just tty devices that receive hangup
> events. Having the modem connection disappear and the USB device
> disappear isn't all that different from a conceptual point of view.

Oh, I forgot that this came up while we were drinking at the LinuxCon
Japan conference this year and we figured out that you could just use
the 'unbind' and 'bind' files in sysfs to disconnect and reconnect the
device from the driver from userspace which would simulate a revoke()
call on pretty much any type of char device we have today.

Sure, it's crude, and yes, it's the result of a lot of whisky, but even
now, it still seems like a nice hack if you really want and need this
from userspace :)

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/