All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] kcov: collect coverage from usb soft interrupts
@ 2020-03-09 18:27 Andrey Konovalov
  2020-03-09 18:27 ` [PATCH v2 1/3] kcov: cleanup debug messages Andrey Konovalov
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andrey Konovalov @ 2020-03-09 18:27 UTC (permalink / raw)
  To: Dmitry Vyukov
  Cc: Greg Kroah-Hartman, Alan Stern, Andrew Morton, linux-usb,
	linux-kernel, Alexander Potapenko, Marco Elver, Andrey Konovalov

This patchset extends kcov to allow collecting coverage from soft
interrupts and then uses the new functionality to collect coverage from
USB code.

This has allowed to find at least one new HID bug [1], which was recently
fixed by Alan [2].

[1] https://syzkaller.appspot.com/bug?extid=09ef48aa58261464b621
[2] https://patchwork.kernel.org/patch/11283319/

Any subsystem that uses softirqs (e.g. timers) can make use of this in
the future. Looking at the recent syzbot reports, an obvious candidate
is the networking subsystem [3, 4, 5 and many more].

[3] https://syzkaller.appspot.com/bug?extid=522ab502c69badc66ab7
[4] https://syzkaller.appspot.com/bug?extid=57f89d05946c53dbbb31
[5] https://syzkaller.appspot.com/bug?extid=df358e65d9c1b9d3f5f4

This patchset has been pushed to the public Linux kernel Gerrit instance:

https://linux-review.googlesource.com/c/linux/kernel/git/torvalds/linux/+/2225

Changes v1 -> v2:
- Add local_irq_save/restore() critical sections to simplify dealing with
  softirqs happening during kcov_remote_start/stop().
- Set kcov_softirq after flag kcov_start() in kcov_remote_start().

Changes RFC -> v1:
- Don't support hardirq or nmi, only softirq, to avoid issues with nested
  interrupts.
- Combined multiple per-cpu variables into one.
- Used plain accesses and kcov_start/stop() instead of xchg()'s.
- Simplified handling of per-cpu variables.
- Avoid disabling interrupts for the whole kcov_remote_start/stop()
  region.
- Avoid overwriting t->kcov_sequence when saving/restoring state.
- Move kcov_remote_start/stop_usb() annotations into
  __usb_hcd_giveback_urb() to cover all urb complete() callbacks at once.
- Drop unneeded Dummy HCD changes.
- Split out a patch that removed debug messages.

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>

Andrey Konovalov (3):
  kcov: cleanup debug messages
  kcov: collect coverage from interrupts
  usb: core: kcov: collect coverage from usb complete callback

 Documentation/dev-tools/kcov.rst |  17 +--
 drivers/usb/core/hcd.c           |   3 +
 include/linux/sched.h            |   3 +
 kernel/kcov.c                    | 221 +++++++++++++++++++++----------
 lib/Kconfig.debug                |   9 ++
 5 files changed, 178 insertions(+), 75 deletions(-)

-- 
2.25.1.481.gfbce0eb801-goog


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-13 14:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2020-03-13 14:56     ` Andrey Konovalov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.