lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADUfDZrpJuq7QH47XTBvCFsENm88WQGX2YYnEPHat_UD6nLC=A@mail.gmail.com>
Date: Tue, 2 Sep 2025 20:32:43 -0700
From: Caleb Sander Mateos <csander@...estorage.com>
To: Jens Axboe <axboe@...nel.dk>
Cc: io-uring@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] io_uring: remove WRITE_ONCE() in io_uring_create()

On Tue, Sep 2, 2025 at 6:20 PM Jens Axboe <axboe@...nel.dk> wrote:
>
> On 9/2/25 3:51 PM, Caleb Sander Mateos wrote:
> > There's no need to use WRITE_ONCE() to set ctx->submitter_task in
> > io_uring_create() since no other thread can access the io_ring_ctx until
> > a file descriptor is associated with it. So use a normal assignment
> > instead of WRITE_ONCE().
>
> Would probably warrant a code comment to that effect, as just reading
> the code would be slightly confusing after this.

Could you elaborate on why you find it confusing? I wouldn't expect to
see WRITE_ONCE() or any other atomic operation used when initializing
memory prior to it being made accessible from other threads. It looks
like commit 8579538c89e3 ("io_uring/msg_ring: fix remote queue to
disabled ring") added the WRITE_ONCE() both here and in
io_register_enable_rings(). But it's only needed in
io_register_enable_rings(), where the io_ring_ctx already has an
associated file descriptor and may be accessed concurrently from
multiple threads.

Thanks,
Caleb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ