linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Andrey Konovalov <andreyknvl@google.com>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	kasan-dev@googlegroups.com, Dmitry Vyukov <dvyukov@google.com>,
	Shuah Khan <shuah@kernel.org>,
	Alexander Potapenko <glider@google.com>,
	Marco Elver <elver@google.com>,
	Nazime Hande Harputluoglu <handeharput@gmail.com>
Subject: Re: [PATCH v5] kcov, usb: only collect coverage from __usb_hcd_giveback_urb in softirq
Date: Mon, 28 Dec 2020 15:52:50 +0100	[thread overview]
Message-ID: <X+nxQo7q2n4dGzoy@kroah.com> (raw)
In-Reply-To: <d7035335fdfe7493067fbf7d677db57807a42d5d.1606175031.git.andreyknvl@google.com>

On Tue, Nov 24, 2020 at 12:47:25AM +0100, Andrey Konovalov wrote:
> Currently there's a kcov remote coverage collection section in
> __usb_hcd_giveback_urb(). Initially that section was added based on the
> assumption that usb_hcd_giveback_urb() can only be called in interrupt
> context as indicated by a comment before it. This is what happens when
> syzkaller is fuzzing the USB stack via the dummy_hcd driver.
> 
> As it turns out, it's actually valid to call usb_hcd_giveback_urb() in task
> context, provided that the caller turned off the interrupts; USB/IP does
> exactly that. This can lead to a nested KCOV remote coverage collection
> sections both trying to collect coverage in task context. This isn't
> supported by kcov, and leads to a WARNING.
> 
> Change __usb_hcd_giveback_urb() to only call kcov_remote_*() callbacks
> when it's being executed in a softirq. To avoid calling
> in_serving_softirq() directly in the driver code, add a couple of new kcov
> wrappers.
> 
> As the result of this change, the coverage from USB/IP related
> usb_hcd_giveback_urb() calls won't be collected, but the WARNING is fixed.
> 
> A potential future improvement would be to support nested remote coverage
> collection sections, but this patch doesn't address that.
> 
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> Acked-by: Marco Elver <elver@google.com>
> ---
> 
> Changes in v5:
> - Don't call in_serving_softirq() in USB driver code directly, do that
>   via kcov wrappers.

Does not apply to 5.11-rc1 :(

  reply	other threads:[~2020-12-28 14:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23 23:47 [PATCH v5] kcov, usb: only collect coverage from __usb_hcd_giveback_urb in softirq Andrey Konovalov
2020-12-28 14:52 ` Greg Kroah-Hartman [this message]
2021-01-05 19:47   ` 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=X+nxQo7q2n4dGzoy@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=andreyknvl@google.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=handeharput@gmail.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=shuah@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).