linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: How to use Udev to restrict USB access only to particular set of
Date: Thu, 24 Feb 2011 15:46:07 +0000	[thread overview]
Message-ID: <20110224154607.GA5960@kroah.com> (raw)
In-Reply-To: <AANLkTinqeg=o_bmdR0CKuVmP14x71kkrE3=zdaxx2AE=@mail.gmail.com>

On Thu, Feb 24, 2011 at 03:52:16PM +0200, Vilius Benetis wrote:
> On Tue, Feb 22, 2011 at 4:38 PM, Greg KH <greg@kroah.com> wrote:
> > Ok, what is the udev rule that you tried and did not work?
> 
> we tried to disable USB storage sticks with the following command:
> 
> SUBSYSTEMS="usb" DRIVERS="usb-storage"  OPTIONS:="ignore_device"
> 
> but we failed to make it work.

Ignoring the device still makes it "active" in the system, especially as
you just tested that the usb-storage device was bound to your device
(which wouldn't be true that early in the process, which is one reason
why this failed).  

you need to write a 0 to the "authorized" file in sysfs which will
disable the whole USB device entirely if it meets your "list of devices
to reject".  You also need to test not for driver binding, which again
will not have happened, and you don't want to have happen, but that it
is a usb storage device type (by virtue of the correct class config
options as shown by sysfs) and that it doesn't pass your list of valid
serial numbers.

Note, all of that might be easier to do in a script than in a udev rule
alone, but it should be possible.

Hope this helps,

greg k-h

  parent reply	other threads:[~2011-02-24 15:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-21  9:01 How to use Udev to restrict USB access only to particular set of USB sticks? Vilius Benetis
2011-02-21  9:05 ` How to use Udev to restrict USB access only to particular set of Andrey Borzenkov
2011-02-21  9:27 ` Vilius Benetis
2011-02-21 15:57 ` How to use Udev to restrict USB access only to particular set Greg KH
2011-02-22 13:46 ` How to use Udev to restrict USB access only to particular set of Vilius Benetis
2011-02-22 13:54 ` How to use Udev to restrict USB access only to particular set Greg KH
2011-02-22 14:01 ` How to use Udev to restrict USB access only to particular set of Vilius Benetis
2011-02-22 14:28 ` Vilius Benetis
2011-02-22 14:38 ` How to use Udev to restrict USB access only to particular set Greg KH
2011-02-24 13:52 ` How to use Udev to restrict USB access only to particular set of Vilius Benetis
2011-02-24 15:46 ` Greg KH [this message]
2011-02-24 16:36 ` Vilius Benetis
2011-02-24 17:01 ` Greg KH
2011-02-24 17:36 ` Vilius Benetis
2011-03-01 14:32 ` Vilius Benetis
2011-03-02  7:06 ` How to use Udev to restrict USB access only to particular set Bryan Kadzban
2011-03-02  8:33 ` How to use Udev to restrict USB access only to particular set of Vilius Benetis
2011-03-03  4:01 ` How to use Udev to restrict USB access only to particular set Bryan Kadzban

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110224154607.GA5960@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).