[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Write protect access on USB port



Andrei POPESCU <andreimpopescu <at> gmail.com> writes:

> 
> On Lu, 26 nov 12, 21:47:36, Amit wrote:
> > 
> > Yes the above would work in most cases but in the case I am dealing
> > with, the filesystem is not mounted yet. For example, I plug in a USB
> > drive.  Before it is mounted, there is a /dev/sd[x] node. I can open
> > this node and write anything I want, thereby corrupting the filesystem
> > on that device.
> 
> Not unless you are 'root' or member of group 'floppy':
> 
> $ ls -l /dev/sdb1
> brw-rw---T 1 root floppy 8, 17 nov 27 00:14 /dev/sdb1
> 
> You could just tweak the relevant udev rule to create the device nodes 
> as root:root or root:disk (like hard drives), since root would be able 
> to circumvent any protection and 'disk' is almost the same as 'root'.
> 
> Kind regards,
> Andrei

Thanks for the reply.

Yes, I basically want to avoid even the root user (or process with root
privileges) to able to access this. So the kernel has to be replaced in
order to disable the "write protect" on that USB port.

It is more of a guarantee that there can be no accidental write on that
device plugged in to that port.

Thanks,
Amit


Reply to: