CHROMIUM: device_jail: detach all interfaces

permission_broker iterates through every available interface of
the USB device to detach drivers. We should do the same thing
here.

BUG=chromium:644338
TEST=On kevin:
  kill permission_broker, set up device_jail_utility server.
  Use lsusb -t to find a device with an attached kernel driver,
  i.e. btusb, add a jail for it
  In python:
  >>> f = open("/dev/jailed-189-XXX", "rb")
  Choose "detach" in the server. Check syslog, lsusb -t again
  to make sure the driver was detached.
  In python:
  >>> f.close()
  Ensure the driver is reattached. (If using btusb you can also
  check visually that the bluetooth menu disables itself when
  you detach the driver, and re-enables itself when you attach
  it again.)

Change-Id: I4fe7f7ccbcba9cfc8d7d5ab8ab44677145f58dca
Reviewed-on: https://chromium-review.googlesource.com/441105
Commit-Ready: Eric Caruso <ejcaruso@chromium.org>
Tested-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
1 file changed