Skip to content

Commit cc18cc5

Browse files
isilenceaxboe
authored andcommitted
io_uring: mem-account pbuf buckets
Potentially, someone may create as many pbuf bucket as there are indexes in an xarray without any other restrictions bounding our memory usage, put memory needed for the buckets under memory accounting. Cc: <[email protected]> Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/d34c452e45793e978d26e2606211ec9070d329ea.1659622312.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent f482aa9 commit cc18cc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/kbuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ int io_provide_buffers(struct io_kiocb *req, unsigned int issue_flags)
436436

437437
bl = io_buffer_get_list(ctx, p->bgid);
438438
if (unlikely(!bl)) {
439-
bl = kzalloc(sizeof(*bl), GFP_KERNEL);
439+
bl = kzalloc(sizeof(*bl), GFP_KERNEL_ACCOUNT);
440440
if (!bl) {
441441
ret = -ENOMEM;
442442
goto err;

0 commit comments

Comments
 (0)