linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Marcello Sylvester Bauer <sylv@sylv.io>,
	Dmitry Vyukov <dvyukov@google.com>,
	Aleksandr Nogikh <nogikh@google.com>,
	Marco Elver <elver@google.com>,
	Alexander Potapenko <glider@google.com>,
	kasan-dev@googlegroups.com,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	syzbot+2388cdaeb6b10f0c13ac@syzkaller.appspotmail.com,
	syzbot+17ca2339e34a1d863aad@syzkaller.appspotmail.com,
	stable@vger.kernel.org, andrey.konovalov@linux.dev
Subject: Re: [PATCH] usb: gadget: dummy_hcd: execute hrtimer callback in softirq context
Date: Tue, 3 Sep 2024 09:09:53 +0200	[thread overview]
Message-ID: <2024090332-whomever-careless-5b7d@gregkh> (raw)
In-Reply-To: <CA+fCnZc7qVTmH2neiCn3T44+C-CCyxfCKNc0FP3F9Cu0oKtBRQ@mail.gmail.com>

On Tue, Aug 27, 2024 at 02:02:00AM +0200, Andrey Konovalov wrote:
> On Mon, Jul 29, 2024 at 4:23 AM <andrey.konovalov@linux.dev> wrote:
> >
> > From: Andrey Konovalov <andreyknvl@gmail.com>
> >
> > Commit a7f3813e589f ("usb: gadget: dummy_hcd: Switch to hrtimer transfer
> > scheduler") switched dummy_hcd to use hrtimer and made the timer's
> > callback be executed in the hardirq context.
> >
> > With that change, __usb_hcd_giveback_urb now gets executed in the hardirq
> > context, which causes problems for KCOV and KMSAN.
> >
> > One problem is that KCOV now is unable to collect coverage from
> > the USB code that gets executed from the dummy_hcd's timer callback,
> > as KCOV cannot collect coverage in the hardirq context.
> >
> > Another problem is that the dummy_hcd hrtimer might get triggered in the
> > middle of a softirq with KCOV remote coverage collection enabled, and that
> > causes a WARNING in KCOV, as reported by syzbot. (I sent a separate patch
> > to shut down this WARNING, but that doesn't fix the other two issues.)
> >
> > Finally, KMSAN appears to ignore tracking memory copying operations
> > that happen in the hardirq context, which causes false positive
> > kernel-infoleaks, as reported by syzbot.
> >
> > Change the hrtimer in dummy_hcd to execute the callback in the softirq
> > context.
> >
> > Reported-by: syzbot+2388cdaeb6b10f0c13ac@syzkaller.appspotmail.com
> > Closes: https://syzkaller.appspot.com/bug?extid=2388cdaeb6b10f0c13ac
> > Reported-by: syzbot+17ca2339e34a1d863aad@syzkaller.appspotmail.com
> > Closes: https://syzkaller.appspot.com/bug?extid=17ca2339e34a1d863aad
> > Fixes: a7f3813e589f ("usb: gadget: dummy_hcd: Switch to hrtimer transfer scheduler")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Andrey Konovalov <andreyknvl@gmail.com>
> 
> Hi Greg,
> 
> Could you pick up either this or Marcello's patch
> (https://lkml.org/lkml/2024/6/26/969)? In case they got lost.

Both are lost now, (and please use lore.kernel.org, not lkml.org), can
you resend the one that you wish to see accepted?

thanks,

greg k-h


  reply	other threads:[~2024-09-03  7:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29  2:23 [PATCH] usb: gadget: dummy_hcd: execute hrtimer callback in softirq context andrey.konovalov
2024-07-29  8:25 ` Marcello Sylvester Bauer
2024-07-29 16:14   ` Andrey Konovalov
2024-07-29 18:01     ` Alan Stern
2024-07-30 13:43       ` Andrey Konovalov
2024-08-09 15:22 ` Alexander Potapenko
2024-08-27  0:02 ` Andrey Konovalov
2024-09-03  7:09   ` Greg Kroah-Hartman [this message]
2024-09-04  1:34     ` 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=2024090332-whomever-careless-5b7d@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=andrey.konovalov@linux.dev \
    --cc=andreyknvl@gmail.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=nogikh@google.com \
    --cc=stable@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=sylv@sylv.io \
    --cc=syzbot+17ca2339e34a1d863aad@syzkaller.appspotmail.com \
    --cc=syzbot+2388cdaeb6b10f0c13ac@syzkaller.appspotmail.com \
    /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).