From: Peter Chen <peter.chen@nxp.com>
To: Andrey Konovalov <andreyknvl@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alan Stern <stern@rowland.harvard.edu>,
Andrew Morton <akpm@linux-foundation.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Alexander Potapenko <glider@google.com>,
Marco Elver <elver@google.com>
Subject: Re: [PATCH v2 3/3] usb: core: kcov: collect coverage from usb complete callback
Date: Thu, 12 Mar 2020 09:39:18 +0000 [thread overview]
Message-ID: <20200312093920.GD14625@b29397-desktop> (raw)
In-Reply-To: <32bce32c8b88c2f88cd0a8acfcdb5d3a6e894632.1583778264.git.andreyknvl@google.com>
On 20-03-09 19:27:06, Andrey Konovalov wrote:
> This patch adds kcov_remote_start/stop() callbacks around the urb
> complete() callback that is executed in softirq context when dummy_hcd
> is in use. As the result, kcov can be used to collect coverage from those
> those callbacks, which is used to facilitate coverage-guided fuzzing with
Typo, One more "those"
Peter
> syzkaller.
>
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> ---
> drivers/usb/core/hcd.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index aa45840d8273..de624c47e190 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -31,6 +31,7 @@
> #include <linux/types.h>
> #include <linux/genalloc.h>
> #include <linux/io.h>
> +#include <linux/kcov.h>
>
> #include <linux/phy/phy.h>
> #include <linux/usb.h>
> @@ -1645,7 +1646,9 @@ static void __usb_hcd_giveback_urb(struct urb *urb)
>
> /* pass ownership to the completion handler */
> urb->status = status;
> + kcov_remote_start_usb((u64)urb->dev->bus->busnum);
> urb->complete(urb);
> + kcov_remote_stop();
>
> usb_anchor_resume_wakeups(anchor);
> atomic_dec(&urb->use_count);
> --
> 2.25.1.481.gfbce0eb801-goog
>
--
Thanks,
Peter Chen
next prev parent reply other threads:[~2020-03-12 9:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-09 18:27 [PATCH v2 0/3] kcov: collect coverage from usb soft interrupts Andrey Konovalov
2020-03-09 18:27 ` [PATCH v2 1/3] kcov: cleanup debug messages Andrey Konovalov
2020-03-09 18:27 ` [PATCH v2 2/3] kcov: collect coverage from interrupts Andrey Konovalov
2020-03-09 18:27 ` [PATCH v2 3/3] usb: core: kcov: collect coverage from usb complete callback Andrey Konovalov
2020-03-12 9:39 ` Peter Chen [this message]
2020-03-13 14:56 ` Andrey Konovalov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200312093920.GD14625@b29397-desktop \
--to=peter.chen@nxp.com \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@google.com \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox