crosvm/seccomp/x86_64/xhci.policy
Daniel Verkamp 3bebfa29dc usb: reset backend device on port reset
This enables the full firmware update/reset/use device in application
mode sequence for Edge TPU USB Accelerator.

There is a bit of a UI hiccup: once the firmware update and reset is
complete, the device re-enumerates with a different VID/PID, and the
"Connect to Linux" prompt shows up again.  The user must re-affirm that
the device should be connected to Linux to proceed with using the Edge
TPU.  This may be unavoidable - I'm not sure if we can tell the
difference between a newly-inserted device and a reset one.

Allowing USBDEVFS_DISCONNECT_CLAIM should be safe, since it can only
operate on file descriptors passed into the xhci device jail.

BUG=chromium:831850
TEST=Run Edge TPU Accelerator demo and verify that it can update FW

Change-Id: I3d61c7bd914830ce25448b1ae4d60e1c16f10aed
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1599881
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2019-06-05 19:19:10 +00:00

42 lines
1.2 KiB
Text

# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# xhci need "openat" to enumerate device. "openat" is disabled in comman_device policy.
openat: 1
@include /usr/share/policy/crosvm/common_device.policy
lstat: 1
gettid: 1
readlinkat: 1
timerfd_create: 1
name_to_handle_at: 1
access: 1
timerfd_create: 1
getsockname: 1
pipe: 1
setsockopt: 1
bind: 1
fcntl: 1
socket: arg0 == AF_NETLINK
stat: 1
uname: 1
# The following ioctls are:
# 0x4008550d == USBDEVFS_REAPURBNDELAY
# 0x41045508 == USBDEVFS_GETDRIVER
# 0x550b == USBDEVFS_DISCARDURB
# 0x8004550f == USBDEVFS_CLAIMINTERFACE
# 0x80045510 == USBDEVFS_RELEASEINTERFACE
# 0x8004551a == USBDEVFS_GET_CAPABILITIES
# 0x8038550a == USBDEVFS_SUBMITURB
# 0xc0185500 == USBDEVFS_CONTROL
# 0x5514 == USBDEVFS_RESET
# 0x80045505 == USBDEVFS_SETCONFIGURATION
# 0x8108551b == USBDEVFS_DISCONNECT_CLAIM
ioctl: arg1 == 0xc0185500 || arg1 == 0x41045508 || arg1 == 0x8004550f || arg1 == 0x4008550d || arg1 == 0x8004551a || arg1 == 0x550b || arg1 == 0x80045510 || arg1 == 0x8038550a || arg1 == 0x5514 || arg1 == 0x80045505 || arg1 == 0x8108551b
fstat: 1
sigaltstack: 1
recvmsg: 1
getrandom: 1
getdents: 1