Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3312312ybc; Thu, 14 Nov 2019 07:15:31 -0800 (PST) X-Google-Smtp-Source: APXvYqzOUqwU0qm8CpGLeIa3jakcYtMoD0k6gsINwHy8mOKWQgjbRUgFHki8qiB1Eqtk8hbHKlv6 X-Received: by 2002:a05:6402:213:: with SMTP id t19mr1845408edv.7.1573744531501; Thu, 14 Nov 2019 07:15:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573744531; cv=none; d=google.com; s=arc-20160816; b=jcytwCFtN3oa8foNu0vxDYW9gps9ouAf9TwaTpDeCrMoa3S2jlvmTKcbfAs19984Iq /DOU1JOn//3QdPIoBhs3OjTQaEhPBH4jUNVzksd/YOoFYqf0jbN2MaJKS5EPJsSKSEig hMAvyQJcr8VYlpf5vr4X2ziDu44nGH+H66Mn3LK4qQd1jR2nwXlpFO+pgMYVJo2gVmEF eRvLmcKmheHkcxD91wEPxzjEVBbwFxTT2qaFerbQza0MbO4sg4+4B5PB2kXbA+b6IEER cGCLheYjVWZXQp+NPxXR334aZoy38IpAFLfL9sLWIE98v5qYYigf1ESypam7GkXY0tpE WuKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=roRKIOX40b6Q/3+a+NshMVYzTrBfNeebY8L+kjytXRs=; b=R5ybr/68Ue7di/jjds267VN/PKK9F1jp4fUzqFypk0pdHH+RxJLLC+tOV1ORLldKNj jKLMm01VY2ReR7e7bu7Q7+ZI+0Z4PL8z1Ye2qMorY7XMNL4UBCVvSySZW9S1OIppJUsW i3pK4FyqJy/9sXlHZn759fjY20Xoq/Y3G8t3DkeDsHuFzPC/O6C9tI+N5wml5fy1gqrW F76wFJEuDRA8HdW1ctrivxWe584b0oVd3iARXGywpoD+5ExBTmkMdhfafu2NGIS0cQk5 EbCQ4LjoX/SM96rMIy7wiMS/XdslIyfyZxBdB1YipBvkfNYLkWCN6uq7UHBYm06bx+EK B+cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=kVX53tvf; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id be23si3919884edb.103.2019.11.14.07.15.06; Thu, 14 Nov 2019 07:15:31 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=kVX53tvf; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727104AbfKNPLC (ORCPT + 99 others); Thu, 14 Nov 2019 10:11:02 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:44747 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727078AbfKNPLB (ORCPT ); Thu, 14 Nov 2019 10:11:01 -0500 Received: by mail-pf1-f194.google.com with SMTP id q26so4419516pfn.11 for ; Thu, 14 Nov 2019 07:11:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=roRKIOX40b6Q/3+a+NshMVYzTrBfNeebY8L+kjytXRs=; b=kVX53tvflJrZ7i67dieAEPqJqgEgquhZFRAnVlI2YJDx22zztmIu11TLh4NDNAFN+T CX2YMO3wEPmmGACgjIYO7Xy0Ky3FlajlIbzeAr+2yadmJKDMhAyXwQXfkf2czRxnIchB zIRqC3mXkttBVprXoxuF3wc4pxgrHCB9YFiLkEOyNb5uONi/4ghGFaWSYip7g3fS0OiA QZYsqd8CHe50zJ9urtLSHndShhunx6Enr4KdX3E3ThBnXOD4SCrBwkWhONnRqZBDYHUt 6XRB3xhz5g/NPTOsOWJf+7E0aodZKkybEyE09+8ASgfLlm7I3bD/SrZOerG8F+K5W9d3 v9xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=roRKIOX40b6Q/3+a+NshMVYzTrBfNeebY8L+kjytXRs=; b=FC+WhLzVfz8OGmp8HQpGNbQ5Ddu0a5tyVOYSySN+kJXHB9+F087kPA1SowYffLi+OW FvRwg7wzuolNuA2CPVbXbw7RoKFZeN5lVATuwE9lqY7IQ2pku6GhrNgNICFlNahqu3vb xzrxfAk/K6cKiH4/2U0VIPj9o9O5nFXRKvEdjBgpnn9BFqfrZTBbUF7lvJmdqmdo9uQt eFZyaNr+x090uzUa/IGso5bNLprZryCfLvTisJjZZ7chFj1i343iEycFKWyJIGjGRB7D JfyD1R+kv3tfMPqL0ZTSJOturifCdghSWc+nQbUDL7Pz5CN6JRMnRdxa3lLUpjKbYIjw d3KQ== X-Gm-Message-State: APjAAAV3jwYmjdE+E/pxT5fvNy+ZuoU2OxO/GEZz81zWl8xeiXoQIClw xtfcISzeuLkWyKhWTllU3ruWmUcdSX3J6bhS9VvlRw== X-Received: by 2002:a63:541e:: with SMTP id i30mr10665060pgb.130.1573744260540; Thu, 14 Nov 2019 07:11:00 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andrey Konovalov Date: Thu, 14 Nov 2019 16:10:49 +0100 Message-ID: Subject: Re: [PATCH 0/1] usb: gadget: add raw-gadget interface To: Alan Stern Cc: USB list , LKML , Greg Kroah-Hartman , Jonathan Corbet , Felipe Balbi , Dmitry Vyukov , Alexander Potapenko , Marco Elver Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 8, 2019 at 11:18 PM Andrey Konovalov wrote: > > On Fri, Nov 8, 2019 at 10:45 PM Alan Stern wrote: > > > > 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. > > Hi Alan! Sure, I'll move it to legacy/ in v2. Thanks! Hi Alan, Should I move CONFIG_USB_RAW_GADGET into legacy/Kconfig as well? AFAIU this makes it impossible to turn on e.g. both GadgetFS and Raw Gadget at the same time, since they both become options of the same choice. Thanks!