memset(&ctx->restrictions, 0, sizeof(ctx->restrictions));
return ret;
}
+ if (ctx->restrictions.registered)
+ ctx->restricted = 1;
return 0;
}
io_activate_pollwq(ctx);
}
- if (ctx->restrictions.registered)
- ctx->restricted = 1;
-
/* Keep submitter_task store before clearing IORING_SETUP_R_DISABLED */
smp_store_release(&ctx->flags, ctx->flags & ~IORING_SETUP_R_DISABLED);
if (ctx->sq_data && wq_has_sleeper(&ctx->sq_data->wait))
if (ctx->submitter_task && ctx->submitter_task != current)
return -EEXIST;
- if (ctx->restricted) {
+ if (ctx->restricted && !(ctx->flags & IORING_SETUP_R_DISABLED)) {
opcode = array_index_nospec(opcode, IORING_REGISTER_LAST);
if (!test_bit(opcode, ctx->restrictions.register_op))
return -EACCES;