Skip to contentSkip to conversation

io_uring/bpf_filter: use bpf_prog_run_pin_on_cpu() to prevent migration

PATCH New Jens Axboe 1 participant 1 message Mar 10 io_uring

lore
Share & tools
lore

Jens Axboe

author maintainer
#0 lore raw

PATCH 1/1 io_uring/bpf_filter: use bpf_prog_run_pin_on_cpu() to prevent migration

Since the caller, __io_uring_run_bpf_filters(), doesn't prevent migration, it should use the migration disabling variant for running the BPF program.

Fixes d42eb05e60fe ("io_uring: add support for BPF filtering for opcode restrictions")

---

io_uring/bpf_filter.c +1 -1
index 28a23e92ee81..9cc44764e0ac 100644
@@ -85,7 +85,7 @@ int __io_uring_run_bpf_filters(struct io_bpf_filter __rcu **filters,
 	do {
 		if (filter == &dummy_filter)
 			return -EACCES;
-		ret = bpf_prog_run(filter->prog, &bpf_ctx);
+		ret = bpf_prog_run_pin_on_cpu(filter->prog, &bpf_ctx);
 		if (!ret)
 			return -EACCES;
 		filter = filter->next;
Signature · 1 line
Jens Axboe