[lkml]   [2019]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH v2 0/1] usb: gadget: add raw-gadget interface
This patchset (currently a single patch) adds a new userspace interface
for the USB Gadget subsystem called USB Raw Gadget (I don't mind changing
the name to something else if there are better ideas). This is what
currently being used to enable coverage-buided USB fuzzing with syzkaller:

Initially I was using GadgetFS (together with the Dummy HCD/UDC module)
to perform emulation of USB devices for fuzzing, but later switched to a
custom written interface. The incentive to implement a different interface
was to provide a somewhat raw and direct access to the USB Gadget layer
for the userspace, where every USB request is passed to the userspace to
get a response. See documentation for the list of differences between
Raw Gadget and GadgetFS.

This patchset has been pushed to the public Linux kernel Gerrit instance:

Changes v1 -> v2:
- Moved raw.c to legacy/.
- Changed uapi header to use __u* types.
- Switched from debugfs entry to a misc device.
- Changed raw_dev from refcount to kref.
- Moved UDC_NAME_LENGTH_MAX to uapi headers.
- Used usb_endpoint_type() and usb_endpoint_dir_in/out() functions instead
of open coding them.
- Added "WITH Linux-syscall-note" to SPDX id in the uapi header.
- Removed pr_err() if case dev_new() fails.
- Reduced the number of debugging messages.

Andrey Konovalov (1):
usb: gadget: add raw-gadget interface

Documentation/usb/index.rst | 1 +
Documentation/usb/raw-gadget.rst | 60 ++
drivers/usb/gadget/legacy/Kconfig | 8 +
drivers/usb/gadget/legacy/Makefile | 1 +
drivers/usb/gadget/legacy/raw.c | 1057 +++++++++++++++++++++++++++
include/uapi/linux/usb/raw_gadget.h | 167 +++++
6 files changed, 1294 insertions(+)
create mode 100644 Documentation/usb/raw-gadget.rst
create mode 100644 drivers/usb/gadget/legacy/raw.c
create mode 100644 include/uapi/linux/usb/raw_gadget.h


 \ /
  Last update: 2019-11-15 14:38    [W:0.077 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site