[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210529003350.m3bqhb3rnug7yby7@alap3.anarazel.de>
Date: Fri, 28 May 2021 17:33:50 -0700
From: Andres Freund <andres@...razel.de>
To: Pavel Begunkov <asml.silence@...il.com>,
Jens Axboe <axboe@...nel.dk>, io-uring@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Memory uninitialized after "io_uring: keep table of pointers to
ubufs"
Hi,
I started to see buffer registration randomly failing with ENOMEM on
5.13. Registering buffer or two often succeeds, but more than that
rarely. Running the same program as root succeeds - but the user has a high
rlimit.
The issue is that io_sqe_buffer_register() doesn't initialize
imu. io_buffer_account_pin() does imu->acct_pages++, before calling
io_account_mem(ctx, imu->acct_pages);
Which means that a random amount of memory is being accounted for. On the first
few allocations this sometimes fails to fail because the memory is zero, but
after a bit of reuse...
It only doesn't fail as root because the rlimit doesn't apply.
This is caused by
commit 41edf1a5ec967bf4bddedb83c48e02dfea8315b4
Author: Pavel Begunkov <asml.silence@...il.com>
Date: 2021-04-25 14:32:23 +0100
io_uring: keep table of pointers to ubufs
Greetings,
Andres Freund
Powered by blists - more mailing lists