Files
linux/kernel
Jann Horn 1d9c949369 kcov: allow simultaneous KCOV_ENABLE/KCOV_REMOTE_ENABLE
Allow the same userspace thread to simultaneously collect normal coverage
in syscall context (KCOV_ENABLE) and remote coverage of asynchronous work
created by the thread (KCOV_REMOTE_ENABLE).  With this, remote KCOV
coverage becomes useful for generic fuzzing and not just fuzzing of
specific data injection interfaces.

This requires that the task_struct::kcov_* fields are separated into ones
that are used by the task that generates coverage, and ones that are used
by the task that requested remote coverage.  To split this up:

 - Split task_struct::kcov into kcov and kcov_remote. kcov_task_exit() now
   has to clean up both separately.
 - Only use task_struct::kcov_mode on the task that generates coverage.
 - Only reset task_struct::kcov_handle on the task that requested remote
   coverage.

After this change, fields used by the task that generates coverage are:

 - kcov_mode
 - kcov_size
 - kcov_area
 - kcov
 - kcov_sequence
 - kcov_softirq

Fields used by the task that requested remote coverage are:

 - kcov_remote
 - kcov_handle

[[email protected]: remove unused constant KCOV_MODE_REMOTE, per Dmitry]
  Link: https://lore.kernel.org/[email protected]
[[email protected]: update documentation on remote coverage collection]
  Link: https://lore.kernel.org/[email protected]
[[email protected]: move and reword sentence on simultaneous normal/remote collection
  Link: https://lore.kernel.org/[email protected]
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Jann Horn <[email protected]>
Reviewed-by: Dmitry Vyukov <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Cc: Andrey Konovalov <[email protected]>
Cc: Marco Elver <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
2026-05-28 21:24:51 -07:00
..
2026-03-06 14:31:26 +01:00
2026-03-06 14:31:26 +01:00
2026-03-05 22:16:08 -05:00
…
…
…
…
…
…
…
2026-01-05 16:43:34 +01:00
…
…
…
2026-03-27 10:19:08 -05:00
…
2025-10-29 10:29:54 +01:00
2026-01-26 19:07:13 -08:00
…
…
…