Message ID | 20241017115029.178246-2-felix.moessbauer@siemens.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [5.10,5.15,1/3] io_uring/sqpoll: do not allow pinning outside of cpuset | expand |
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 6b6fd244233f8..a260852a0490c 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -8751,6 +8751,8 @@ static int io_sq_offload_create(struct io_ring_ctx *ctx, int cpu = p->sq_thread_cpu; ret = -EINVAL; + if (cpu >= nr_cpu_ids || !cpu_online(cpu)) + goto err_sqpoll; cpuset_cpus_allowed(current, &allowed_mask); if (!cpumask_test_cpu(cpu, &allowed_mask)) goto err_sqpoll;