Skip to contentSkip to conversation

io_uring: annotate remote tasks for kcoverage

PATCH Superseded Robert Femmer 4 participants 12 messages May 20 – Jun 30

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring: annotate remote tasks for kcoverage

Fuzzers use coverage information to guide generation of test cases towards new or interesting code paths. Syzkaller, specifically, makes use kcoverage (CONFIG_KCOV). Coverage information is not collected for kernel tasks unless annotated by kcov_remote_start and kcov_remote_stop. This patch annotates io-uring's work queue and sqpoll tasks.

The value of the handle needs to be passed by userspace when enabling remote coverage collection. I chose the cgroup ns inum, because it is predictable and flexible enough for consumers to control which group of processes should be included for remote coverage collection, should they create an instance of io-uring.

---
 include/linux/io_uring_types.h |  4 ++++
 include/uapi/linux/kcov.h      |  1 +
 io_uring/io-wq.c               |  4 ++++
 io_uring/io_uring.c            | 18 ++++++++++++++++++
 io_uring/io_uring.h            | 22 ++++++++++++++++++++++
 io_uring/sqpoll.c              |  4 ++++
 kernel/kcov.c                  |  2 ++
 7 files changed, 55 insertions(+)
include/linux/io_uring_types.h +4 -0
index 244392026c6d..b92b8e7169ea 100644
@@ -504,6 +504,10 @@ struct io_ring_ctx {
 	struct io_mapped_region		ring_region;
 	/* used for optimised request parameter and wait argument passing  */
 	struct io_mapped_region		param_region;
+
+#ifdef CONFIG_KCOV
+	u64				kcov_handle;
+#endif
 };
 
 /*
include/uapi/linux/kcov.h +1 -0
index ed95dba9fa37..15bbce4569b1 100644
@@ -49,6 +49,7 @@ enum {
 
 #define KCOV_SUBSYSTEM_COMMON	(0x00ull << 56)
 #define KCOV_SUBSYSTEM_USB	(0x01ull << 56)
+#define KCOV_SUBSYSTEM_IOURING	(0x02ull << 56)
 
 #define KCOV_SUBSYSTEM_MASK	(0xffull << 56)
 #define KCOV_INSTANCE_MASK	(0xffffffffull)
io_uring/io-wq.c +4 -0
index 8cc7b47d3089..bb89d3f4b3dc 100644
@@ -639,6 +639,7 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
 		/* handle a whole dependent link */
 		do {
 			struct io_wq_work *next_hashed, *linked;
+			struct io_kiocb *req;
 			unsigned int work_flags = atomic_read(&work->flags);
 			unsigned int hash = __io_wq_is_hashed(work_flags)
 				? __io_get_work_hash(work_flags)
@@ -649,7 +650,10 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
 			if (do_kill &&
 			    (work_flags & IO_WQ_WORK_UNBOUND))
 				atomic_or(IO_WQ_WORK_CANCEL, &work->flags);
+			req = container_of(work, struct io_kiocb, work);
+			io_kcov_remote_start(req->ctx);
 			io_wq_submit_work(work);
+			io_kcov_remote_stop();
 			io_assign_current_work(worker, NULL);
 
 			linked = io_wq_free_work(work);
io_uring/io_uring.c +18 -0
index 036145ee466c..71478e6ccae4 100644
@@ -222,6 +222,21 @@ static void io_free_alloc_caches(struct io_ring_ctx *ctx)
 	io_rsrc_cache_free(ctx);
 }
 
+#ifdef CONFIG_KCOV
+static __cold u64 io_ring_get_kcov_handle(void)
+{
+	struct nsproxy *ns_proxy = current->nsproxy;
+	struct ns_common *ns;
+	u64 inst = 0;
+
+	if (ns_proxy) {
+		ns = to_ns_common(ns_proxy->cgroup_ns);
+		inst = ns->inum;
+	}
+	return kcov_remote_handle(KCOV_SUBSYSTEM_IOURING, inst);
+}
+#endif
+
 static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)
 {
 	struct io_ring_ctx *ctx;
@@ -293,6 +308,9 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)
 	INIT_HLIST_HEAD(&ctx->cancelable_uring_cmd);
 	io_napi_init(ctx);
 	mutex_init(&ctx->mmap_lock);
+#ifdef CONFIG_KCOV
+	ctx->kcov_handle = io_ring_get_kcov_handle();
+#endif
 
 	return ctx;
 
io_uring/io_uring.h +22 -0
index e612a66ee80e..cb03df877456 100644
@@ -7,6 +7,7 @@
 #include <linux/resume_user_mode.h>
 #include <linux/poll.h>
 #include <linux/io_uring_types.h>
+#include <linux/kcov.h>
 #include <uapi/linux/eventpoll.h>
 #include "alloc_cache.h"
 #include "io-wq.h"
@@ -581,4 +582,25 @@ static inline bool io_has_work(struct io_ring_ctx *ctx)
 	return test_bit(IO_CHECK_CQ_OVERFLOW_BIT, &ctx->check_cq) ||
 	       io_local_work_pending(ctx);
 }
+
+#ifdef CONFIG_KCOV
+static inline void io_kcov_remote_start(struct io_ring_ctx *ctx)
+{
+	kcov_remote_start(ctx->kcov_handle);
+}
+
+static inline void io_kcov_remote_stop(void)
+{
+	kcov_remote_stop();
+}
+#else
+static inline void io_kcov_remote_start(struct io_ring_ctx *ctx)
+{
+}
+
+static inline void io_kcov_remote_stop(void)
+{
+}
+#endif
+
 #endif
io_uring/sqpoll.c +4 -0
index 46c12afec73e..b244abd37a27 100644
@@ -342,19 +342,23 @@ static int io_sq_thread(void *data)
 
 		cap_entries = !list_is_singular(&sqd->ctx_list);
 		list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
+			io_kcov_remote_start(ctx);
 			int ret = __io_sq_thread(ctx, sqd, cap_entries, &ist);
 
 			if (!sqt_spin && (ret > 0 || !list_empty(&ctx->iopoll_list)))
 				sqt_spin = true;
+			io_kcov_remote_stop();
 		}
 		if (io_sq_tw(&retry_list, IORING_TW_CAP_ENTRIES_VALUE))
 			sqt_spin = true;
 
 		list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
+			io_kcov_remote_start(ctx);
 			if (io_napi(ctx)) {
 				io_sq_start_worktime(&ist);
 				io_napi_sqpoll_busy_poll(ctx);
 			}
+			io_kcov_remote_stop();
 		}
 
 		io_sq_update_worktime(sqd, &ist);
kernel/kcov.c +2 -0
index 0b369e88c7c9..6df04581a126 100644
@@ -585,6 +585,8 @@ static inline bool kcov_check_handle(u64 handle, bool common_valid,
 			common_valid : zero_valid;
 	case KCOV_SUBSYSTEM_USB:
 		return uncommon_valid;
+	case KCOV_SUBSYSTEM_IOURING:
+		return uncommon_valid;
 	default:
 		return false;
 	}
Signature · 1 line
2.54.0
#1 lore raw
Quoted 44 lines · Robert Femmer

Fuzzers use coverage information to guide generation of test cases towards new or interesting code paths. Syzkaller, specifically, makes use kcoverage (CONFIG_KCOV). Coverage information is not collected for kernel tasks unless annotated by kcov_remote_start and kcov_remote_stop. This patch annotates io-uring's work queue and sqpoll tasks.

The value of the handle needs to be passed by userspace when enabling remote coverage collection. I chose the cgroup ns inum, because it is predictable and flexible enough for consumers to control which group of processes should be included for remote coverage collection, should they create an instance of io-uring.

---
 include/linux/io_uring_types.h |  4 ++++
 include/uapi/linux/kcov.h      |  1 +
 io_uring/io-wq.c               |  4 ++++
 io_uring/io_uring.c            | 18 ++++++++++++++++++
 io_uring/io_uring.h            | 22 ++++++++++++++++++++++
 io_uring/sqpoll.c              |  4 ++++
 kernel/kcov.c                  |  2 ++
 7 files changed, 55 insertions(+)
include/linux/io_uring_types.h +4 -0
index 244392026c6d..b92b8e7169ea 100644
@@ -504,6 +504,10 @@ struct io_ring_ctx {
        struct io_mapped_region         ring_region;
        /* used for optimised request parameter and wait argument passing  */
        struct io_mapped_region         param_region;
+
+#ifdef CONFIG_KCOV
+       u64                             kcov_handle;
+#endif
 };
 
 /*
include/uapi/linux/kcov.h +0 -0
index ed95dba9fa37..15bbce4569b1 100644

include/uapi/linux/kcov.h enum { · line 52

Quoted 4 lines
include/uapi/linux/kcov.h +1 -0
@@ -49,6 +49,7 @@ enum {
 
 #define KCOV_SUBSYSTEM_COMMON  (0x00ull << 56)
 #define KCOV_SUBSYSTEM_USB     (0x01ull << 56)
+#define KCOV_SUBSYSTEM_IOURING (0x02ull << 56)

Hi Robet,

Would it be possible to use the common_handle functionality of KCOV for io_uring?

The global KCOV handles were not the best design decision. They arguably make sense for kernel tasks that get created during boot. But if a kernel task gets spawned as a result of a user task actions, the common handles are a better approach.

Quoted 144 lines
include/uapi/linux/kcov.h +0 -0
 #define KCOV_SUBSYSTEM_MASK    (0xffull << 56)
 #define KCOV_INSTANCE_MASK     (0xffffffffull)
io_uring/io-wq.c +4 -0
index 8cc7b47d3089..bb89d3f4b3dc 100644
@@ -639,6 +639,7 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
                /* handle a whole dependent link */
                do {
                        struct io_wq_work *next_hashed, *linked;
+                       struct io_kiocb *req;
                        unsigned int work_flags = atomic_read(&work->flags);
                        unsigned int hash = __io_wq_is_hashed(work_flags)
                                ? __io_get_work_hash(work_flags)
@@ -649,7 +650,10 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
                        if (do_kill &&
                            (work_flags & IO_WQ_WORK_UNBOUND))
                                atomic_or(IO_WQ_WORK_CANCEL, &work->flags);
+                       req = container_of(work, struct io_kiocb, work);
+                       io_kcov_remote_start(req->ctx);
                        io_wq_submit_work(work);
+                       io_kcov_remote_stop();
                        io_assign_current_work(worker, NULL);
 
                        linked = io_wq_free_work(work);
io_uring/io_uring.c +18 -0
index 036145ee466c..71478e6ccae4 100644
@@ -222,6 +222,21 @@ static void io_free_alloc_caches(struct io_ring_ctx *ctx)
        io_rsrc_cache_free(ctx);
 }
 
+#ifdef CONFIG_KCOV
+static __cold u64 io_ring_get_kcov_handle(void)
+{
+       struct nsproxy *ns_proxy = current->nsproxy;
+       struct ns_common *ns;
+       u64 inst = 0;
+
+       if (ns_proxy) {
+               ns = to_ns_common(ns_proxy->cgroup_ns);
+               inst = ns->inum;
+       }
+       return kcov_remote_handle(KCOV_SUBSYSTEM_IOURING, inst);
+}
+#endif
+
 static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)
 {
        struct io_ring_ctx *ctx;
@@ -293,6 +308,9 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)
        INIT_HLIST_HEAD(&ctx->cancelable_uring_cmd);
        io_napi_init(ctx);
        mutex_init(&ctx->mmap_lock);
+#ifdef CONFIG_KCOV
+       ctx->kcov_handle = io_ring_get_kcov_handle();
+#endif
 
        return ctx;
 
io_uring/io_uring.h +22 -0
index e612a66ee80e..cb03df877456 100644
@@ -7,6 +7,7 @@
 #include <linux/resume_user_mode.h>
 #include <linux/poll.h>
 #include <linux/io_uring_types.h>
+#include <linux/kcov.h>
 #include <uapi/linux/eventpoll.h>
 #include "alloc_cache.h"
 #include "io-wq.h"
@@ -581,4 +582,25 @@ static inline bool io_has_work(struct io_ring_ctx *ctx)
        return test_bit(IO_CHECK_CQ_OVERFLOW_BIT, &ctx->check_cq) ||
               io_local_work_pending(ctx);
 }
+
+#ifdef CONFIG_KCOV
+static inline void io_kcov_remote_start(struct io_ring_ctx *ctx)
+{
+       kcov_remote_start(ctx->kcov_handle);
+}
+
+static inline void io_kcov_remote_stop(void)
+{
+       kcov_remote_stop();
+}
+#else
+static inline void io_kcov_remote_start(struct io_ring_ctx *ctx)
+{
+}
+
+static inline void io_kcov_remote_stop(void)
+{
+}
+#endif
+
 #endif
io_uring/sqpoll.c +4 -0
index 46c12afec73e..b244abd37a27 100644
@@ -342,19 +342,23 @@ static int io_sq_thread(void *data)
 
                cap_entries = !list_is_singular(&sqd->ctx_list);
                list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
+                       io_kcov_remote_start(ctx);
                        int ret = __io_sq_thread(ctx, sqd, cap_entries, &ist);
 
                        if (!sqt_spin && (ret > 0 || !list_empty(&ctx->iopoll_list)))
                                sqt_spin = true;
+                       io_kcov_remote_stop();
                }
                if (io_sq_tw(&retry_list, IORING_TW_CAP_ENTRIES_VALUE))
                        sqt_spin = true;
 
                list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
+                       io_kcov_remote_start(ctx);
                        if (io_napi(ctx)) {
                                io_sq_start_worktime(&ist);
                                io_napi_sqpoll_busy_poll(ctx);
                        }
+                       io_kcov_remote_stop();
                }
 
                io_sq_update_worktime(sqd, &ist);
kernel/kcov.c +2 -1
index 0b369e88c7c9..6df04581a126 100644
@@ -585,6 +585,8 @@ static inline bool kcov_check_handle(u64 handle, bool common_valid,
                        common_valid : zero_valid;
        case KCOV_SUBSYSTEM_USB:
                return uncommon_valid;
+       case KCOV_SUBSYSTEM_IOURING:
+               return uncommon_valid;
        default:
                return false;
        }
--

2.54.0

#2 lore raw

PATCH v2 1/1 io_uring: annotate remote tasks for kcoverage

Fuzzers use coverage information to guide generation of test cases towards new or interesting code paths. Syzkaller, specifically, makes use kcoverage (CONFIG_KCOV). Coverage information is not collected for kernel tasks unless annotated by kcov_remote_start and kcov_remote_stop. This patch annotates io-uring's work queue and sqpoll tasks.

---
 include/linux/io_uring_types.h |  4 ++++
 io_uring/io-wq.c               |  4 ++++
 io_uring/io_uring.c            |  3 +++
 io_uring/io_uring.h            | 24 ++++++++++++++++++++++++
 io_uring/sqpoll.c              |  4 ++++
 5 files changed, 39 insertions(+)
include/linux/io_uring_types.h +4 -0
index 244392026c6d..b92b8e7169ea 100644
@@ -504,6 +504,10 @@ struct io_ring_ctx {
 	struct io_mapped_region		ring_region;
 	/* used for optimised request parameter and wait argument passing  */
 	struct io_mapped_region		param_region;
+
+#ifdef CONFIG_KCOV
+	u64				kcov_handle;
+#endif
 };
 
 /*
io_uring/io-wq.c +4 -0
index 8cc7b47d3089..16af75b1cfe0 100644
@@ -639,6 +639,7 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
 		/* handle a whole dependent link */
 		do {
 			struct io_wq_work *next_hashed, *linked;
+			struct io_kiocb *req;
 			unsigned int work_flags = atomic_read(&work->flags);
 			unsigned int hash = __io_wq_is_hashed(work_flags)
 				? __io_get_work_hash(work_flags)
@@ -649,7 +650,10 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
 			if (do_kill &&
 			    (work_flags & IO_WQ_WORK_UNBOUND))
 				atomic_or(IO_WQ_WORK_CANCEL, &work->flags);
+			req = container_of(work, struct io_kiocb, work);
+			io_kcov_remote_start(req->ctx);
 			io_wq_submit_work(work);
+			io_kcov_remote_stop(req->ctx);
 			io_assign_current_work(worker, NULL);
 
 			linked = io_wq_free_work(work);
io_uring/io_uring.c +3 -0
index 036145ee466c..f38b8eca6bbb 100644
@@ -293,6 +293,9 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)
 	INIT_HLIST_HEAD(&ctx->cancelable_uring_cmd);
 	io_napi_init(ctx);
 	mutex_init(&ctx->mmap_lock);
+#ifdef CONFIG_KCOV
+	ctx->kcov_handle = current->kcov_handle;
+#endif
 
 	return ctx;
 
io_uring/io_uring.h +24 -0
index e612a66ee80e..881d43bd529c 100644
@@ -7,6 +7,7 @@
 #include <linux/resume_user_mode.h>
 #include <linux/poll.h>
 #include <linux/io_uring_types.h>
+#include <linux/kcov.h>
 #include <uapi/linux/eventpoll.h>
 #include "alloc_cache.h"
 #include "io-wq.h"
@@ -581,4 +582,27 @@ static inline bool io_has_work(struct io_ring_ctx *ctx)
 	return test_bit(IO_CHECK_CQ_OVERFLOW_BIT, &ctx->check_cq) ||
 	       io_local_work_pending(ctx);
 }
+
+#ifdef CONFIG_KCOV
+static inline void io_kcov_remote_start(struct io_ring_ctx *ctx)
+{
+	if (ctx->kcov_handle)
+		kcov_remote_start(ctx->kcov_handle);
+}
+
+static inline void io_kcov_remote_stop(struct io_ring_ctx *ctx)
+{
+	if (ctx->kcov_handle)
+		kcov_remote_stop();
+}
+#else
+static inline void io_kcov_remote_start(struct io_ring_ctx *ctx)
+{
+}
+
+static inline void io_kcov_remote_stop(struct io_ring_ctx *ctx)
+{
+}
+#endif
+
 #endif
io_uring/sqpoll.c +4 -0
index 46c12afec73e..8d2876e31acb 100644
@@ -342,19 +342,23 @@ static int io_sq_thread(void *data)
 
 		cap_entries = !list_is_singular(&sqd->ctx_list);
 		list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
+			io_kcov_remote_start(ctx);
 			int ret = __io_sq_thread(ctx, sqd, cap_entries, &ist);
 
 			if (!sqt_spin && (ret > 0 || !list_empty(&ctx->iopoll_list)))
 				sqt_spin = true;
+			io_kcov_remote_stop(ctx);
 		}
 		if (io_sq_tw(&retry_list, IORING_TW_CAP_ENTRIES_VALUE))
 			sqt_spin = true;
 
 		list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
+			io_kcov_remote_start(ctx);
 			if (io_napi(ctx)) {
 				io_sq_start_worktime(&ist);
 				io_napi_sqpoll_busy_poll(ctx);
 			}
+			io_kcov_remote_stop(ctx);
 		}
 
 		io_sq_update_worktime(sqd, &ist);
Signature · 1 line
2.54.0
#3 lore raw
Quoted 21 lines · Robert Femmer

Fuzzers use coverage information to guide generation of test cases towards new or interesting code paths. Syzkaller, specifically, makes use kcoverage (CONFIG_KCOV). Coverage information is not collected for kernel tasks unless annotated by kcov_remote_start and kcov_remote_stop. This patch annotates io-uring's work queue and sqpoll tasks.

---
 include/linux/io_uring_types.h |  4 ++++
 io_uring/io-wq.c               |  4 ++++
 io_uring/io_uring.c            |  3 +++
 io_uring/io_uring.h            | 24 ++++++++++++++++++++++++
 io_uring/sqpoll.c              |  4 ++++
 5 files changed, 39 insertions(+)
include/linux/io_uring_types.h +0 -0
index 244392026c6d..b92b8e7169ea 100644

include/linux/io_uring_types.h struct io_ring_ctx { · line 510

Quoted 7 lines
include/linux/io_uring_types.h +4 -0
@@ -504,6 +504,10 @@ struct io_ring_ctx {
        struct io_mapped_region         ring_region;
        /* used for optimised request parameter and wait argument passing  */
        struct io_mapped_region         param_region;
+
+#ifdef CONFIG_KCOV
+       u64                             kcov_handle;
+#endif

Jann recently sent a patch that added kcov_common_handle_id, I think you can base your code on it and use that helper struct here.

https://lore.kernel.org/all/20260430-kcov-refactor-common-handle-v1-1-23a0c7a0ba38@google.com/

Quoted 16 lines
include/linux/io_uring_types.h +0 -0
 };
 
 /*
io_uring/io-wq.c +1 -0
index 8cc7b47d3089..16af75b1cfe0 100644
@@ -639,6 +639,7 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
                /* handle a whole dependent link */
                do {
                        struct io_wq_work *next_hashed, *linked;
+                       struct io_kiocb *req;
                        unsigned int work_flags = atomic_read(&work->flags);
                        unsigned int hash = __io_wq_is_hashed(work_flags)
                                ? __io_get_work_hash(work_flags)

io_uring/io-wq.c static void io_worker_handle_work(struct io_wq_acct *acct, · line 654

Quoted 5 lines
io_uring/io-wq.c +2 -0
@@ -649,7 +650,10 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
                        if (do_kill &&
                            (work_flags & IO_WQ_WORK_UNBOUND))
                                atomic_or(IO_WQ_WORK_CANCEL, &work->flags);
+                       req = container_of(work, struct io_kiocb, work);
+                       io_kcov_remote_start(req->ctx);

And also use kcov_remote_start_common() here.

Quoted 94 lines
io_uring/io-wq.c +1 -0
                        io_wq_submit_work(work);
+                       io_kcov_remote_stop(req->ctx);
                        io_assign_current_work(worker, NULL);
 
                        linked = io_wq_free_work(work);
io_uring/io_uring.c +3 -0
index 036145ee466c..f38b8eca6bbb 100644
@@ -293,6 +293,9 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)
        INIT_HLIST_HEAD(&ctx->cancelable_uring_cmd);
        io_napi_init(ctx);
        mutex_init(&ctx->mmap_lock);
+#ifdef CONFIG_KCOV
+       ctx->kcov_handle = current->kcov_handle;
+#endif
 
        return ctx;
 
io_uring/io_uring.h +24 -0
index e612a66ee80e..881d43bd529c 100644
@@ -7,6 +7,7 @@
 #include <linux/resume_user_mode.h>
 #include <linux/poll.h>
 #include <linux/io_uring_types.h>
+#include <linux/kcov.h>
 #include <uapi/linux/eventpoll.h>
 #include "alloc_cache.h"
 #include "io-wq.h"
@@ -581,4 +582,27 @@ static inline bool io_has_work(struct io_ring_ctx *ctx)
        return test_bit(IO_CHECK_CQ_OVERFLOW_BIT, &ctx->check_cq) ||
               io_local_work_pending(ctx);
 }
+
+#ifdef CONFIG_KCOV
+static inline void io_kcov_remote_start(struct io_ring_ctx *ctx)
+{
+       if (ctx->kcov_handle)
+               kcov_remote_start(ctx->kcov_handle);
+}
+
+static inline void io_kcov_remote_stop(struct io_ring_ctx *ctx)
+{
+       if (ctx->kcov_handle)
+               kcov_remote_stop();
+}
+#else
+static inline void io_kcov_remote_start(struct io_ring_ctx *ctx)
+{
+}
+
+static inline void io_kcov_remote_stop(struct io_ring_ctx *ctx)
+{
+}
+#endif
+
 #endif
io_uring/sqpoll.c +4 -1
index 46c12afec73e..8d2876e31acb 100644
@@ -342,19 +342,23 @@ static int io_sq_thread(void *data)
 
                cap_entries = !list_is_singular(&sqd->ctx_list);
                list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
+                       io_kcov_remote_start(ctx);
                        int ret = __io_sq_thread(ctx, sqd, cap_entries, &ist);
 
                        if (!sqt_spin && (ret > 0 || !list_empty(&ctx->iopoll_list)))
                                sqt_spin = true;
+                       io_kcov_remote_stop(ctx);
                }
                if (io_sq_tw(&retry_list, IORING_TW_CAP_ENTRIES_VALUE))
                        sqt_spin = true;
 
                list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
+                       io_kcov_remote_start(ctx);
                        if (io_napi(ctx)) {
                                io_sq_start_worktime(&ist);
                                io_napi_sqpoll_busy_poll(ctx);
                        }
+                       io_kcov_remote_stop(ctx);
                }
 
                io_sq_update_worktime(sqd, &ist);
--

2.54.0

--
You received this message because you are subscribed to the Google Groups "kasan-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/kasan-dev/20260520204303.558392-2-robert%40fmmr.tech.

#4 lore raw

PATCH v3 1/1 io_uring: annotate remote tasks for kcoverage

Fuzzers use coverage information to guide generation of test cases towards new or interesting code paths. Syzkaller, specifically, makes use kcoverage (CONFIG_KCOV). Coverage information is not collected for kernel tasks unless annotated by kcov_remote_start and kcov_remote_stop. This patch annotates io-uring's work queue and sqpoll tasks.

Depends-on: 20260430-kcov-refactor-common-handle-v1-1-23a0c7a0ba38@google.com

---
 include/linux/io_uring_types.h | 2 ++
 io_uring/io-wq.c               | 4 ++++
 io_uring/io_uring.c            | 1 +
 io_uring/io_uring.h            | 2 ++
 io_uring/sqpoll.c              | 4 ++++
 5 files changed, 13 insertions(+)
include/linux/io_uring_types.h +2 -0
index 244392026c6d..b6590b2b350c 100644
@@ -504,6 +504,8 @@ struct io_ring_ctx {
 	struct io_mapped_region		ring_region;
 	/* used for optimised request parameter and wait argument passing  */
 	struct io_mapped_region		param_region;
+
+	struct kcov_common_handle_id	kcov_handle;
 };
 
 /*
io_uring/io-wq.c +4 -0
index 8cc7b47d3089..9ade4c4f4983 100644
@@ -639,6 +639,7 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
 		/* handle a whole dependent link */
 		do {
 			struct io_wq_work *next_hashed, *linked;
+			struct io_kiocb *req;
 			unsigned int work_flags = atomic_read(&work->flags);
 			unsigned int hash = __io_wq_is_hashed(work_flags)
 				? __io_get_work_hash(work_flags)
@@ -649,7 +650,10 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
 			if (do_kill &&
 			    (work_flags & IO_WQ_WORK_UNBOUND))
 				atomic_or(IO_WQ_WORK_CANCEL, &work->flags);
+			req = container_of(work, struct io_kiocb, work);
+			kcov_remote_start_common(req->ctx->kcov_handle);
 			io_wq_submit_work(work);
+			kcov_remote_stop();
 			io_assign_current_work(worker, NULL);
 
 			linked = io_wq_free_work(work);
io_uring/io_uring.c +1 -0
index 103b6c88f252..89cb649944d9 100644
@@ -293,6 +293,7 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)
 	INIT_HLIST_HEAD(&ctx->cancelable_uring_cmd);
 	io_napi_init(ctx);
 	mutex_init(&ctx->mmap_lock);
+	ctx->kcov_handle = kcov_common_handle();
 
 	return ctx;
 
io_uring/io_uring.h +2 -0
index e612a66ee80e..7226fbbbf9f0 100644
@@ -7,6 +7,7 @@
 #include <linux/resume_user_mode.h>
 #include <linux/poll.h>
 #include <linux/io_uring_types.h>
+#include <linux/kcov.h>
 #include <uapi/linux/eventpoll.h>
 #include "alloc_cache.h"
 #include "io-wq.h"
@@ -581,4 +582,5 @@ static inline bool io_has_work(struct io_ring_ctx *ctx)
 	return test_bit(IO_CHECK_CQ_OVERFLOW_BIT, &ctx->check_cq) ||
 	       io_local_work_pending(ctx);
 }
+
 #endif
io_uring/sqpoll.c +4 -0
index 46c12afec73e..c7b78ea98587 100644
@@ -342,19 +342,23 @@ static int io_sq_thread(void *data)
 
 		cap_entries = !list_is_singular(&sqd->ctx_list);
 		list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
+			kcov_remote_start_common(ctx->kcov_handle);
 			int ret = __io_sq_thread(ctx, sqd, cap_entries, &ist);
 
 			if (!sqt_spin && (ret > 0 || !list_empty(&ctx->iopoll_list)))
 				sqt_spin = true;
+			kcov_remote_stop();
 		}
 		if (io_sq_tw(&retry_list, IORING_TW_CAP_ENTRIES_VALUE))
 			sqt_spin = true;
 
 		list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
+			kcov_remote_start_common(ctx->kcov_handle);
 			if (io_napi(ctx)) {
 				io_sq_start_worktime(&ist);
 				io_napi_sqpoll_busy_poll(ctx);
 			}
+			kcov_remote_stop();
 		}
 
 		io_sq_update_worktime(sqd, &ist);
Signature · 1 line
2.54.0
#5 lore raw
Quoted 5 lines · Robert Femmer

Fuzzers use coverage information to guide generation of test cases towards new or interesting code paths. Syzkaller, specifically, makes use kcoverage (CONFIG_KCOV). Coverage information is not collected for kernel tasks unless annotated by kcov_remote_start and kcov_remote_stop. This patch annotates io-uring's work queue and sqpoll tasks.

I think this is a useful change overall.

@maintainers: For context, this should have no impact on normal builds
- "struct kcov_common_handle_id" is zero-sized in normal builds, and all the helpers used here are empty inline functions.

Quoted 63 lines

Depends-on: 20260430-kcov-refactor-common-handle-v1-1-23a0c7a0ba38@google.com

---
 include/linux/io_uring_types.h | 2 ++
 io_uring/io-wq.c               | 4 ++++
 io_uring/io_uring.c            | 1 +
 io_uring/io_uring.h            | 2 ++
 io_uring/sqpoll.c              | 4 ++++
 5 files changed, 13 insertions(+)
include/linux/io_uring_types.h +2 -0
index 244392026c6d..b6590b2b350c 100644
@@ -504,6 +504,8 @@ struct io_ring_ctx {
        struct io_mapped_region         ring_region;
        /* used for optimised request parameter and wait argument passing  */
        struct io_mapped_region         param_region;
+
+       struct kcov_common_handle_id    kcov_handle;
 };
 
 /*
io_uring/io-wq.c +4 -0
index 8cc7b47d3089..9ade4c4f4983 100644
@@ -639,6 +639,7 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
                /* handle a whole dependent link */
                do {
                        struct io_wq_work *next_hashed, *linked;
+                       struct io_kiocb *req;
                        unsigned int work_flags = atomic_read(&work->flags);
                        unsigned int hash = __io_wq_is_hashed(work_flags)
                                ? __io_get_work_hash(work_flags)
@@ -649,7 +650,10 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
                        if (do_kill &&
                            (work_flags & IO_WQ_WORK_UNBOUND))
                                atomic_or(IO_WQ_WORK_CANCEL, &work->flags);
+                       req = container_of(work, struct io_kiocb, work);
+                       kcov_remote_start_common(req->ctx->kcov_handle);
                        io_wq_submit_work(work);
+                       kcov_remote_stop();
                        io_assign_current_work(worker, NULL);
 
                        linked = io_wq_free_work(work);
io_uring/io_uring.c +1 -0
index 103b6c88f252..89cb649944d9 100644
@@ -293,6 +293,7 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)
        INIT_HLIST_HEAD(&ctx->cancelable_uring_cmd);
        io_napi_init(ctx);
        mutex_init(&ctx->mmap_lock);
+       ctx->kcov_handle = kcov_common_handle();
 
        return ctx;
 
io_uring/io_uring.h +0 -0
index e612a66ee80e..7226fbbbf9f0 100644

io_uring/io_uring.h line 10

Quoted 4 lines
io_uring/io_uring.h +1 -0
@@ -7,6 +7,7 @@
 #include <linux/resume_user_mode.h>
 #include <linux/poll.h>
 #include <linux/io_uring_types.h>
+#include <linux/kcov.h>

I think instead of this, normal kernel coding style is to use includes directly in the files where they are needed.
https://docs.kernel.org/process/submit-checklist.html says:
"If you use a facility then #include the file that defines/declares that facility. Don’t depend on other header files pulling in ones that you use."

io_uring/io_uring.h static inline bool io_has_work(struct io_ring_ctx *ctx) · line 586

Quoted 9 lines
io_uring/io_uring.h +1 -0
 #include <uapi/linux/eventpoll.h>
 #include "alloc_cache.h"
 #include "io-wq.h"
@@ -581,4 +582,5 @@ static inline bool io_has_work(struct io_ring_ctx *ctx)
        return test_bit(IO_CHECK_CQ_OVERFLOW_BIT, &ctx->check_cq) ||
               io_local_work_pending(ctx);
 }
+
 #endif

This looks like an accidental whitespace change.

Quoted 15 lines
io_uring/sqpoll.c +2 -0
index 46c12afec73e..c7b78ea98587 100644
@@ -342,19 +342,23 @@ static int io_sq_thread(void *data)
 
                cap_entries = !list_is_singular(&sqd->ctx_list);
                list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
+                       kcov_remote_start_common(ctx->kcov_handle);
                        int ret = __io_sq_thread(ctx, sqd, cap_entries, &ist);
 
                        if (!sqt_spin && (ret > 0 || !list_empty(&ctx->iopoll_list)))
                                sqt_spin = true;
+                       kcov_remote_stop();
                }

io_uring/sqpoll.c static int io_sq_thread(void *data) · line 361

Quoted 10 lines
io_uring/sqpoll.c +2 -0
                if (io_sq_tw(&retry_list, IORING_TW_CAP_ENTRIES_VALUE))
                        sqt_spin = true;
 
                list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
+                       kcov_remote_start_common(ctx->kcov_handle);
                        if (io_napi(ctx)) {
                                io_sq_start_worktime(&ist);
                                io_napi_sqpoll_busy_poll(ctx);
                        }
+                       kcov_remote_stop();

Someone who knows more about networking than me might know this area better, but I think we probably don't want to have KCOV coverage around the call to io_napi_sqpoll_busy_poll() for two reasons:

1. This is NAPI busypolling code, designed to busy-loop until network packets arrive - meaning the limited KCOV coverage buffer will quickly fill up even if no data is actually being processed.
2. As far as I know, io_napi_sqpoll_busy_poll() doesn't really process data related to the uring instance - it (more or less) merely busy-polls network interfaces specified by the user. Received packets are not necessarily actually related to this uring instance.

Quoted 6 lines
io_uring/sqpoll.c +0 -1
                }
 
                io_sq_update_worktime(sqd, &ist);
--

2.54.0

#6 lore raw
Quoted 7 lines · Jann Horn
Quoted 5 lines · Robert Femmer

Fuzzers use coverage information to guide generation of test cases towards new or interesting code paths. Syzkaller, specifically, makes use kcoverage (CONFIG_KCOV). Coverage information is not collected for kernel tasks unless annotated by kcov_remote_start and kcov_remote_stop. This patch annotates io-uring's work queue and sqpoll tasks.

Quoted 5 lines

I think this is a useful change overall.

@maintainers: For context, this should have no impact on normal builds
- "struct kcov_common_handle_id" is zero-sized in normal builds, and all the helpers used here are empty inline functions.

(That was supposed to be "are empty inline functions in normal builds". I should've re-read this before hitting send...)

Quoted 1 line
Quoted 1 line

Depends-on: 20260430-kcov-refactor-common-handle-v1-1-23a0c7a0ba38@google.com

(This landed in mainline in the current merge window.)

#7 lore raw

PATCH v4 1/1 io_uring: annotate remote tasks for kcoverage

In reply to Jann Horn

Fuzzers use coverage information to guide generation of test cases towards new or interesting code paths. Syzkaller, specifically, makes use kcoverage (CONFIG_KCOV). Coverage information is not collected for kernel tasks unless annotated by kcov_remote_start and kcov_remote_stop. This patch annotates io-uring's work queue and sqpoll tasks.

Depends-On: 20260430-kcov-refactor-common-handle-v1-1-23a0c7a0ba38@google.com

---
 include/linux/io_uring_types.h | 2 ++
 io_uring/io-wq.c               | 5 +++++
 io_uring/io_uring.c            | 2 ++
 io_uring/sqpoll.c              | 3 +++
 4 files changed, 12 insertions(+)
include/linux/io_uring_types.h +2 -0
index 244392026c6d..b6590b2b350c 100644
@@ -504,6 +504,8 @@ struct io_ring_ctx {
 	struct io_mapped_region		ring_region;
 	/* used for optimised request parameter and wait argument passing  */
 	struct io_mapped_region		param_region;
+
+	struct kcov_common_handle_id	kcov_handle;
 };
 
 /*
io_uring/io-wq.c +5 -0
index 8cc7b47d3089..173299dfc9c2 100644
@@ -19,6 +19,7 @@
 #include <linux/mmu_context.h>
 #include <linux/sched/sysctl.h>
 #include <uapi/linux/io_uring.h>
+#include <linux/kcov.h>
 
 #include "io-wq.h"
 #include "slist.h"
@@ -639,6 +640,7 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
 		/* handle a whole dependent link */
 		do {
 			struct io_wq_work *next_hashed, *linked;
+			struct io_kiocb *req;
 			unsigned int work_flags = atomic_read(&work->flags);
 			unsigned int hash = __io_wq_is_hashed(work_flags)
 				? __io_get_work_hash(work_flags)
@@ -649,7 +651,10 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
 			if (do_kill &&
 			    (work_flags & IO_WQ_WORK_UNBOUND))
 				atomic_or(IO_WQ_WORK_CANCEL, &work->flags);
+			req = container_of(work, struct io_kiocb, work);
+			kcov_remote_start_common(req->ctx->kcov_handle);
 			io_wq_submit_work(work);
+			kcov_remote_stop();
 			io_assign_current_work(worker, NULL);
 
 			linked = io_wq_free_work(work);
io_uring/io_uring.c +2 -0
index 103b6c88f252..ab7c3e45e238 100644
@@ -59,6 +59,7 @@
 #include <linux/audit.h>
 #include <linux/security.h>
 #include <linux/jump_label.h>
+#include <linux/kcov.h>
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/io_uring.h>
@@ -293,6 +294,7 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)
 	INIT_HLIST_HEAD(&ctx->cancelable_uring_cmd);
 	io_napi_init(ctx);
 	mutex_init(&ctx->mmap_lock);
+	ctx->kcov_handle = kcov_common_handle();
 
 	return ctx;
 
io_uring/sqpoll.c +3 -0
index 46c12afec73e..aafb640d3b2f 100644
@@ -13,6 +13,7 @@
 #include <linux/cpuset.h>
 #include <linux/sched/cputime.h>
 #include <linux/io_uring.h>
+#include <linux/kcov.h>
 
 #include <uapi/linux/io_uring.h>
 
@@ -342,10 +343,12 @@ static int io_sq_thread(void *data)
 
 		cap_entries = !list_is_singular(&sqd->ctx_list);
 		list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
+			kcov_remote_start_common(ctx->kcov_handle);
 			int ret = __io_sq_thread(ctx, sqd, cap_entries, &ist);
 
 			if (!sqt_spin && (ret > 0 || !list_empty(&ctx->iopoll_list)))
 				sqt_spin = true;
+			kcov_remote_stop();
 		}
 		if (io_sq_tw(&retry_list, IORING_TW_CAP_ENTRIES_VALUE))
 			sqt_spin = true;
Signature · 1 line
2.54.0
maintainer
#11 lore raw
In reply to Jann Horn
Quoted 8 lines · Jann Horn
Quoted 5 lines · Robert Femmer

Fuzzers use coverage information to guide generation of test cases towards new or interesting code paths. Syzkaller, specifically, makes use kcoverage (CONFIG_KCOV). Coverage information is not collected for kernel tasks unless annotated by kcov_remote_start and kcov_remote_stop. This patch annotates io-uring's work queue and sqpoll tasks.

I think this is a useful change overall.

Agree, mostly waiting on Andrey and Robert to hash out the details and we can get this landed for 7.3. On vacation the next weeks, not much going on on my end, work wise.

Signature · 1 line
Jens Axboe
reviewer Acked-by on v4 1/1
#8 lore raw
In reply to Robert Femmer
Quoted 106 lines · Robert Femmer

Fuzzers use coverage information to guide generation of test cases towards new or interesting code paths. Syzkaller, specifically, makes use kcoverage (CONFIG_KCOV). Coverage information is not collected for kernel tasks unless annotated by kcov_remote_start and kcov_remote_stop. This patch annotates io-uring's work queue and sqpoll tasks.

Depends-On: 20260430-kcov-refactor-common-handle-v1-1-23a0c7a0ba38@google.com

---
 include/linux/io_uring_types.h | 2 ++
 io_uring/io-wq.c               | 5 +++++
 io_uring/io_uring.c            | 2 ++
 io_uring/sqpoll.c              | 3 +++
 4 files changed, 12 insertions(+)
include/linux/io_uring_types.h +2 -0
index 244392026c6d..b6590b2b350c 100644
@@ -504,6 +504,8 @@ struct io_ring_ctx {
        struct io_mapped_region         ring_region;
        /* used for optimised request parameter and wait argument passing  */
        struct io_mapped_region         param_region;
+
+       struct kcov_common_handle_id    kcov_handle;
 };
 
 /*
io_uring/io-wq.c +5 -0
index 8cc7b47d3089..173299dfc9c2 100644
@@ -19,6 +19,7 @@
 #include <linux/mmu_context.h>
 #include <linux/sched/sysctl.h>
 #include <uapi/linux/io_uring.h>
+#include <linux/kcov.h>
 
 #include "io-wq.h"
 #include "slist.h"
@@ -639,6 +640,7 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
                /* handle a whole dependent link */
                do {
                        struct io_wq_work *next_hashed, *linked;
+                       struct io_kiocb *req;
                        unsigned int work_flags = atomic_read(&work->flags);
                        unsigned int hash = __io_wq_is_hashed(work_flags)
                                ? __io_get_work_hash(work_flags)
@@ -649,7 +651,10 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
                        if (do_kill &&
                            (work_flags & IO_WQ_WORK_UNBOUND))
                                atomic_or(IO_WQ_WORK_CANCEL, &work->flags);
+                       req = container_of(work, struct io_kiocb, work);
+                       kcov_remote_start_common(req->ctx->kcov_handle);
                        io_wq_submit_work(work);
+                       kcov_remote_stop();
                        io_assign_current_work(worker, NULL);
 
                        linked = io_wq_free_work(work);
io_uring/io_uring.c +2 -0
index 103b6c88f252..ab7c3e45e238 100644
@@ -59,6 +59,7 @@
 #include <linux/audit.h>
 #include <linux/security.h>
 #include <linux/jump_label.h>
+#include <linux/kcov.h>
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/io_uring.h>
@@ -293,6 +294,7 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)
        INIT_HLIST_HEAD(&ctx->cancelable_uring_cmd);
        io_napi_init(ctx);
        mutex_init(&ctx->mmap_lock);
+       ctx->kcov_handle = kcov_common_handle();
 
        return ctx;
 
io_uring/sqpoll.c +3 -1
index 46c12afec73e..aafb640d3b2f 100644
@@ -13,6 +13,7 @@
 #include <linux/cpuset.h>
 #include <linux/sched/cputime.h>
 #include <linux/io_uring.h>
+#include <linux/kcov.h>
 
 #include <uapi/linux/io_uring.h>
 
@@ -342,10 +343,12 @@ static int io_sq_thread(void *data)
 
                cap_entries = !list_is_singular(&sqd->ctx_list);
                list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
+                       kcov_remote_start_common(ctx->kcov_handle);
                        int ret = __io_sq_thread(ctx, sqd, cap_entries, &ist);
 
                        if (!sqt_spin && (ret > 0 || !list_empty(&ctx->iopoll_list)))
                                sqt_spin = true;
+                       kcov_remote_stop();
                }
                if (io_sq_tw(&retry_list, IORING_TW_CAP_ENTRIES_VALUE))
                        sqt_spin = true;
--
Quoted 2 lines

2.54.0

From KCOV API side:

Thanks!

maintainer
#9 lore raw
In reply to Robert Femmer
Quoted 13 lines · Robert Femmer
io_uring/io-wq.c +1 -0
index 8cc7b47d3089..173299dfc9c2 100644
@@ -19,6 +19,7 @@
 #include <linux/mmu_context.h>
 #include <linux/sched/sysctl.h>
 #include <uapi/linux/io_uring.h>
+#include <linux/kcov.h>
 
 #include "io-wq.h"
 #include "slist.h"

io_uring/io-wq.c static void io_worker_handle_work(struct io_wq_acct *acct, · line 646

Quoted 7 lines
io_uring/io-wq.c +1 -0
@@ -639,6 +640,7 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
 		/* handle a whole dependent link */
 		do {
 			struct io_wq_work *next_hashed, *linked;
+			struct io_kiocb *req;
 			unsigned int work_flags = atomic_read(&work->flags);
 			unsigned int hash = __io_wq_is_hashed(work_flags)
 				? __io_get_work_hash(work_flags)

We try to, roughly, keep this in reverse xmas tree order. I've fixed it up.

Quoted 13 lines
io_uring/sqpoll.c +1 -0
index 46c12afec73e..aafb640d3b2f 100644
@@ -13,6 +13,7 @@
 #include <linux/cpuset.h>
 #include <linux/sched/cputime.h>
 #include <linux/io_uring.h>
+#include <linux/kcov.h>
 
 #include <uapi/linux/io_uring.h>
 

io_uring/sqpoll.c static int io_sq_thread(void *data) · line 347

Quoted 5 lines
io_uring/sqpoll.c +1 -0
@@ -342,10 +343,12 @@ static int io_sq_thread(void *data)
 
 		cap_entries = !list_is_singular(&sqd->ctx_list);
 		list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
+			kcov_remote_start_common(ctx->kcov_handle);
 			int ret = __io_sq_thread(ctx, sqd, cap_entries, &ist);

Never code before variable declarations in the scope. I've also fixed that one up.

Also not sure what branch this was against, because it doesn't apply to any current one. Guessing something old? I had applied 2 hunks, fwiw. Please check the result!

Signature · 1 line
Jens Axboe
maintainer Applied
#10 lore raw
In reply to Robert Femmer
Quoted 8 lines · Robert Femmer

Fuzzers use coverage information to guide generation of test cases towards new or interesting code paths. Syzkaller, specifically, makes use kcoverage (CONFIG_KCOV). Coverage information is not collected for kernel tasks unless annotated by kcov_remote_start and kcov_remote_stop. This patch annotates io-uring's work queue and sqpoll tasks.

[...]

Applied, thanks!

[1/1] io_uring: annotate remote tasks for kcoverage

      commit: c905736a46892e4776efc7f50888d67715d6ec08

Best regards,

Signature · 1 line
Jens Axboe