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] [day] [month] [year] [list]
Message-ID: <3d0b7db2-59ae-b33c-694e-87d3d659c25e@kernel.dk>
Date:   Sun, 5 Apr 2020 15:25:24 -0700
From:   Jens Axboe <axboe@...nel.dk>
To:     Pavel Begunkov <asml.silence@...il.com>, io-uring@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] io_uring: fix ctx refcounting in io_submit_sqes()

On 4/5/20 3:13 PM, Pavel Begunkov wrote:
> On 06/04/2020 00:08, Pavel Begunkov wrote:
>> If io_get_req() fails, it drops a ref. Then, awhile keeping @submitted
>> unmodified, io_submit_sqes() breaks the loop and puts @nr - @submitted
>> refs. For each submitted req a ref is dropped in io_put_req() and
>> friends. So, for @nr taken refs there will be
>> (@nr - @submitted + @submitted + 1) dropped.
>>
>> Remove ctx refcounting from io_get_req(), that at the same time makes
>> it clearer.
> 
> It seems, nobody hit OOM, so it stayed unnoticed. And neither did I.
> It could be a good idea to do fault-injection for testing.

Actually think we just hit this, was testing with memcached (as per fixes
posted recently), and a bug on the user side ended up with 196G of slab
and running into OOM off request allocation.

But yes, would be nice to have specific fault injection testing to
avoid finding these in prod testing.

-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ