From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BD90478865 for ; Thu, 6 Aug 2026 16:08:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786032481; cv=none; b=SZLyhfDtUcN26O6RKCT9c2LQgUpyAEWCMSqVxFlkSesDv4Lsl8KzqrfPZvXIo+Sl8uVEEUcMmNGZWVF3ubMPkUW9CsPNjl3Nwtva6PzQNhYfuxhTVBAbW/Zu8lYOUQRWQfhzYJr4N9z78CCAdeNuwWLcyTnJd1f7lHtCbYxyLGk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786032481; c=relaxed/simple; bh=ArGsFM3cJ6Rp/xGrIKGWfTn+FGLQ2MN4c2sD46sD0Qo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GZTLnibgDotZkh6/gEYiKpG7c9lCDf8vkmopdaCUdBcHZSItWZu53O6bvrm2i25onY7choKqh5l81sHWie9r6I39C5YnCPQdhOAGUxy2V5Xieoe/0hgEV4XOuVjTHLTF19O8OLZ3fvlqgzYrnEbgZcuGOq8VarQj6lZL4ogd6Wo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ejS9SVja; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ejS9SVja" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-84eb072307dso370488b3a.2 for ; Thu, 06 Aug 2026 09:08:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786032479; x=1786637279; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=lyX2/v766GOIV90GXvGFKE9yXmREQs/QcaigmTO1ry8=; b=ejS9SVjaBAR18P5vRm5VAnlx/KfgfzGZQUsdeJ8tJNfwtzsfHIZECMhCrSknyYGalI E20e+tZUdbzOC94PzxYLVu9Gv9fVqnN6f0/AYSxD5d0/DZYsSijN5jeHE4F631sst6hw GisqgDlaUeBQMdKlr3M+jBg527dsDZenVFCj1JS58pW+cRsCnkTwqhAX2m6WvjRoUzrr KG8r+L/N0qkmEqLD1z2K3eQqzbp9Z6T+tqGzHrSyhMAbpkdt64O54RKITw+QRinu1AT9 +8CPirjAUSdMKn/Ygfx2tREiV9qJGalRputtOvnuQn4vqu9VTp8/II9mdEIF1lDNz9Aw iXsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786032479; x=1786637279; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=lyX2/v766GOIV90GXvGFKE9yXmREQs/QcaigmTO1ry8=; b=NvqL68ANAaAa5MninPTGELohQttotZ2SklY5sMoogXbzqAgJVdKfmxpIOkl/plMUMC i9ojeLQnB+WNaRlfuOHNtZXbeQr3RmdBVL001SORKEkSKFqSt9yJjeebp7SNPVBFbz3X mq+UL92lqmzFr69tzCtBS0PlQqztDk2fJGOVLAaI+QR15EGsP6clylsjRfE7cLAALnmO I1tuRXwrwqDK1lnpfJ36ecw10A73Y9vSvTXxNUHQ4NSxt52mBoMU02BBPDcCSHUWSCMA b/RVpYpJjhbpLa/KIvrmWIhCvhfLXlIKW/NOH9b7caWS4z7O7ujDCpGBkrm4DTpZk98s 16xg== X-Forwarded-Encrypted: i=1; AHgh+RqA7yzogOBCsB/i/wXQYyXX5bS9RXQvdTLm4rr0HZBU+dZIwzYsSBm731DJK6r5l4h5QQr4pjTu/+xrM8M=@vger.kernel.org X-Gm-Message-State: AOJu0YyvrR5OnJ1grETp3iWJiad7Ym2gihaR/dm0cWExccf0nFKwUpQV AFoWUWRH++FO0gUohZXIHG3RIzRc5rd1f9b0jKc3JyEmuvWlztQ6CTQe X-Gm-Gg: AR+sD11BtHn9H9LkXwu5RcPmipWBeeGuM0KmVGUWY76oDA2ebVXfSsGpP6JW+ptLIXt V5jdLXsxmO4nhWl+iviZVaxXmCFcqDtswESpnOKzgC2PGdECjfGhIVVzcdIuBIaId1lLD7K+xCH 54A86zrNGccdB3A4PPB6unv8tq0btu+QphL5DiSU4zMzM/8jGHRDxFH8JMthy+Wv0f+1JVjgYlq SZWR8y18WBsLI2PryKQsuNUsXma+uHn/oGMjEPFV1ucJs0Wi6aHh9p+T01RVmV+PE0UofKqItcb rPmICecCWkOK8zsVVxqOh7WXunnzxmHomytZ839jiNtkMPzLfsOeN5lPSW5vfRtRiEMpc74ZRT+ KpOsjkhFrcnUxyYQ1d2kfWZeAIPt0Bm5rKji68Tgb1NjFUWjKoXpt2NB1hwP8T79os/64ZzeT9I UmO5ZkOCPAsArtzyMzvqBVVTAxMn3skBdJEjb4VO0wVixUPR2f5oe8sp7+owjR X-Received: by 2002:a05:6a00:1807:b0:842:4af4:3080 with SMTP id d2e1a72fcca58-84f2dfb7931mr12420953b3a.1.1786032479389; Thu, 06 Aug 2026 09:07:59 -0700 (PDT) Received: from [192.168.5.2] ([138.199.21.246]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84f454cd0d2sm1698470b3a.27.2026.08.06.09.07.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Aug 2026 09:07:59 -0700 (PDT) Message-ID: Date: Fri, 7 Aug 2026 00:07:56 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 6.1.y] Fix memory leak in io_wq_create() on success path To: Greg KH Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20260806142314.557312-1-shinnkka1@gmail.com> <2026080644-suffix-earthy-2f30@gregkh> <2026080636-financial-iron-4bd9@gregkh> Content-Language: en-US From: Chen Xiaokun In-Reply-To: <2026080636-financial-iron-4bd9@gregkh> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 在 2026/8/6 23:29, Greg KH 写道: > On Thu, Aug 06, 2026 at 10:47:02PM +0800, xk c wrote: >> Greg KH 于2026年8月6日周四 22:33写道: >>> On Thu, Aug 06, 2026 at 10:23:14PM +0800, Chen Xiaokun wrote: >>>> The commit 657ca82526d0 introduced a temporary allowed_mask cpumask in >>>> io_wq_create(), which was freed only on the error path. This caused a >>>> memory leak of cpumask_size() bytes on every successful io_wq_create(). >>>> >>>> Fixes: 657ca82526d0 ("io_uring/io-wq: inherit cpuset of cgroup in io worker") >>>> Signed-off-by: Chen Xiaokun >>>> --- >>>> io_uring/io-wq.c | 1 + >>>> 1 file changed, 1 insertion(+) >>>> >>>> diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c >>>> index 66fdd69fd6cb..34a1a9067cc2 100644 >>>> --- a/io_uring/io-wq.c >>>> +++ b/io_uring/io-wq.c >>>> @@ -1218,6 +1218,7 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data) >>>> wq->task = get_task_struct(data->task); >>>> atomic_set(&wq->worker_refs, 1); >>>> init_completion(&wq->worker_done); >>>> + free_cpumask_var(allowed_mask); >>>> return wq; >>>> err: >>>> io_wq_put_hash(data->hash); >>>> -- >>>> 2.55.0 >>>> >>>> >>> Why is this a stable-only patch? Was the backport wrong? Or is this >>> also in Linus's tree? >>> >> Linus's tree has not this issue. > You need to explain why, in great detail, Linus's tree does not have > this problem in the changelog. > > For example, try answering the questions I asked here, that should > provide you a framework for what to write. > > thnanks, This is a stable-only patch because the backport introduced a temporary allowed_mask variable without freeing it on the success path.  In Linus's tree, it is bound to wq, so there is no memory leak. > greg k-h > > Thanks for your patience, Chen