[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAeHK+ytJCrnJhN8ck0iwbOi=mNzrx150vYxp3GhCmk0Wvi0dA@mail.gmail.com>
Date: Tue, 13 Jun 2017 14:21:08 +0200
From: Andrey Konovalov <andreyknvl@...gle.com>
To: Felipe Balbi <balbi@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Alan Stern <stern@...land.harvard.edu>,
Kees Cook <keescook@...omium.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Andrey Konovalov <andreyknvl@...gle.com>,
Elena Reshetova <elena.reshetova@...el.com>,
USB list <linux-usb@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Cc: syzkaller <syzkaller@...glegroups.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Kostya Serebryany <kcc@...gle.com>
Subject: gadgetfs: how to wait for USB device initialization?
Hi!
I'm trying to use gadgetfs to fuzz USB device drivers by simply
connecting random devices for now.
What I want to achieve right now is the following:
1. mount gadgetfs
2. emulate connection of a new USB device
3. wait for the device to finish initializing
4. unmount gadgetfs
5. goto 1
The question is how do I wait for the device to finish initializing
(the corresponding USB driver to finish probing?) before unmounting
gadgetfs? As I understand, when I write device description to
"/dev/gadget/dummy_udc" the initialization happens asynchronously
after writing is done.
To mount and unmount gadgetfs right now I do:
mount("none", "/dev/gadget", "gadgetfs", 0, NULL)
umount2("/dev/gadget", MNT_FORCE | MNT_DETACH)
Thanks!
Powered by blists - more mailing lists