Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3082294ybx; Fri, 8 Nov 2019 13:46:41 -0800 (PST) X-Google-Smtp-Source: APXvYqz1DPuLzNeGkp8Opl40UV6sN54sIHXd+f5n6HRxrecEvaYbRE/jl7YiE7PfroC2gHZDcEwm X-Received: by 2002:a17:906:8591:: with SMTP id v17mr11122294ejx.185.1573249601155; Fri, 08 Nov 2019 13:46:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573249601; cv=none; d=google.com; s=arc-20160816; b=yl8xgMnTzLEST/0ZxgB2Mv4HYg98ZivGcTXadDh7AKWojJM1hVoA3lJNSAo9GjwtIa XhmBOcMPstmNhi3oPJXuT49Q+4JQ1c+sFvIw9jD6SRMJhyaHspALP2vWJcBfQqp4CeCb Pj/9kjbR6D67RSdIHT4jDnbtO5SPov9pVSR026GBF4TJwFDW3uW3xY4BY0GQf9tdQvsk 8ir3FNCxIEGtl7l9CiCDLjUmElQ75Ef1bJ3At2+QAoSetqVGKVQe6mluIrcZRP+WOEop 4Q+k7SzXrNuYch9vWNI65UGlB6T/aK7kkqgZ+XVCXbMUMFGGDwQC7TSeS4H6e/+5R2Ol tmCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=frCdw3aM6KEbgFz8VvfY3elgejKHDkXOvd7+gcaPNxI=; b=O3EHi6Xe2/Ln+4fSPQe8bJuaOndtKAb+wo1D5FC+pm5MPKGOi1AQ0YJ3CNQE5zx9Vo O7iF6Dp7ViP9j1T2QFNec0Wz7xF/nuXtsznigwPOtjO4+W0/a7XiEaItPR9PESLew9WQ Cfbz5aucYIrYwMFrfJ3+POBXNXkPnQ/VuIsp6Jl8x4QQ7bE5ihxZCqd9t+n6OyPBrTi7 sSAolLhOWeyBFh/RbxF3Nm8qKBul/kCp4W1f8ALJPxkV734Ti0zy2gWJ1NxicxmxPKzW KX/CuQWjTYMA+WTdPSd4DP94chVQ3tj2VgP0KKveJRKDvkrBMxx5gadrHO8nk/FGrmE4 TPPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i30si5899001edd.124.2019.11.08.13.46.17; Fri, 08 Nov 2019 13:46:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731580AbfKHVph (ORCPT + 99 others); Fri, 8 Nov 2019 16:45:37 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:57222 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1728265AbfKHVph (ORCPT ); Fri, 8 Nov 2019 16:45:37 -0500 Received: (qmail 6968 invoked by uid 2102); 8 Nov 2019 16:45:36 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 8 Nov 2019 16:45:36 -0500 Date: Fri, 8 Nov 2019 16:45:36 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Andrey Konovalov cc: linux-usb@vger.kernel.org, , Greg Kroah-Hartman , Jonathan Corbet , Felipe Balbi , Dmitry Vyukov , Alexander Potapenko , Marco Elver Subject: Re: [PATCH 0/1] usb: gadget: add raw-gadget interface In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 8 Nov 2019, Andrey Konovalov wrote: > 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: > > https://github.com/google/syzkaller/blob/master/docs/linux/external_fuzzing_usb.md > > 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: > > https://linux-review.googlesource.com/c/linux/kernel/git/torvalds/linux/+/2144 > > Andrey Konovalov (1): > usb: gadget: add raw-gadget interface > > Documentation/usb/index.rst | 1 + > Documentation/usb/raw-gadget.rst | 60 ++ > drivers/usb/gadget/Kconfig | 9 + > drivers/usb/gadget/Makefile | 2 + > drivers/usb/gadget/raw.c | 1150 +++++++++++++++++++++++++++ As a general rule, gadget drivers don't go directly in drivers/usb/gadget. raw.c counts as a legacy driver (because it's not written to use the composite gadget framework), so it belongs in drivers/usb/gadget/legacy. That's where the gadgetfs driver lives, for example. Alan Stern > include/uapi/linux/usb/raw_gadget.h | 164 ++++ > 6 files changed, 1386 insertions(+) > create mode 100644 Documentation/usb/raw-gadget.rst > create mode 100644 drivers/usb/gadget/raw.c > create mode 100644 include/uapi/linux/usb/raw_gadget.h