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: <6fdccc0d-a309-ee23-bfa8-bf03dc7c6ee1@kernel.dk>
Date:   Thu, 27 Apr 2023 08:35:06 -0600
From:   Jens Axboe <axboe@...nel.dk>
To:     Tudor Cretu <tudor.cretu@....com>, io-uring@...r.kernel.org
Cc:     =axboe@...nel.dk, asml.silence@...il.com, kevin.brodsky@....com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] io_uring/kbuf: Fix size for shared buffer ring

On 4/27/23 8:31?AM, Tudor Cretu wrote:
> The size of the ring is the product of ring_entries and the size of
> struct io_uring_buf. Using struct_size is equivalent to
>   (ring_entries + 1) * sizeof(struct io_uring_buf)
> and generates an off-by-one error. Fix it by using size_mul directly.

Looks right, so we're doing one entry too much. This is probably a
remnant of when the initial version had it done a bit differently, but
we overlaid the tail with the first entry reserved field.

-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ