From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2E98C25B06 for ; Sun, 14 Aug 2022 10:21:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230085AbiHNKVV (ORCPT ); Sun, 14 Aug 2022 06:21:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229723AbiHNKVU (ORCPT ); Sun, 14 Aug 2022 06:21:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 786DF22514 for ; Sun, 14 Aug 2022 03:21:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 300A9B80B3E for ; Sun, 14 Aug 2022 10:21:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82517C433D6; Sun, 14 Aug 2022 10:21:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660472476; bh=49iQcnB3n5TcysljWXzSFiZ0H4q09CzojBJOgcdOR/I=; h=Subject:To:Cc:From:Date:From; b=ANw3dxHM9pVD+cMJa729b2znGFn80cTbjJW+2xV5H53szs5pY01OGXo14RDFAgeG0 KMbZV1YjdMKEl51BeQKm2Z9lV/CyXLUHiAZmIlPLAor6baxtKfQj+7eAHkW8nJycS+ m1c238rcGNmK48eEenUh6RdBpY1+bW16q7DuKPkU= Subject: FAILED: patch "[PATCH] io_uring: mem-account pbuf buckets" failed to apply to 5.19-stable tree To: asml.silence@gmail.com, axboe@kernel.dk, stable@vger.kernel.org Cc: From: Date: Sun, 14 Aug 2022 12:21:14 +0200 Message-ID: <16604724744256@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 5.19-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From cc18cc5e82033d406f54144ad6f8092206004684 Mon Sep 17 00:00:00 2001 From: Pavel Begunkov Date: Thu, 4 Aug 2022 15:13:46 +0100 Subject: [PATCH] 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: Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/d34c452e45793e978d26e2606211ec9070d329ea.1659622312.git.asml.silence@gmail.com Signed-off-by: Jens Axboe diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c index e538fa7cb727..a73f40a4cfe6 100644 --- a/io_uring/kbuf.c +++ b/io_uring/kbuf.c @@ -436,7 +436,7 @@ int io_provide_buffers(struct io_kiocb *req, unsigned int issue_flags) bl = io_buffer_get_list(ctx, p->bgid); if (unlikely(!bl)) { - bl = kzalloc(sizeof(*bl), GFP_KERNEL); + bl = kzalloc(sizeof(*bl), GFP_KERNEL_ACCOUNT); if (!bl) { ret = -ENOMEM; goto err;