Re: [PATCH] io_uring: gate personality per opcode to fix TOCTOU check in io_msg_ring_prep

From: Jens Axboe

Date: Sun Jan 25 2026 - 09:17:56 EST


On 1/25/26 12:53 AM, clingfei wrote:
> From: Cheng Lingfei <clf700383@xxxxxxxxx>
>
> Add allow_personality io_issue_def and reject personality use in
> io_init_req for opcodes that do not permit it. This fixes a TOCTOU
> window in the prior implementation: userspace could race-update
> sqe->personality and bypass the __io_msg_ring_prep personality check.

Please do detail what the bug is here, this looks like some kind of
AI hallucination. The check in msg_ring prep exists just to reject
commands with it set, for future expansion. The only thing that
matters is the ordering and use in io_init_req(), which is fine.

--
Jens Axboe