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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CAD6C48BEB for ; Thu, 22 Feb 2024 02:01:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1817A6B0075; Wed, 21 Feb 2024 21:01:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 10A8F6B0078; Wed, 21 Feb 2024 21:01:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EEDBF6B007B; Wed, 21 Feb 2024 21:01:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id DC17F6B0075 for ; Wed, 21 Feb 2024 21:01:14 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 7A91540C5F for ; Thu, 22 Feb 2024 02:01:14 +0000 (UTC) X-FDA: 81817787268.05.E573F1B Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf01.hostedemail.com (Postfix) with ESMTP id 2A6F740003 for ; Thu, 22 Feb 2024 02:01:10 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of gongruiqi1@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=gongruiqi1@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708567272; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U2CjZXAFuz8xDcs/r2l9GQ555hBOcrffeDOwTIs2O9Y=; b=exAMWyNHPKeTgV5C6LJ9qr2FaLk4M9ktZLLi3hThH7RiC3SwfWcBY+QaqY3+1PKzgZf22h a8RPIR3+z8vvHmP5gSBraQRj4BcGwFJW03JGBFRMjaEIPnm1ouEoAPWxmwzUdQTMCDHGpO EEL099QV90R4UxAxKOZcLxLHsfbmxg4= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of gongruiqi1@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=gongruiqi1@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708567272; a=rsa-sha256; cv=none; b=1OgZZ2QQ+POFbhnVkk8ULTRhG2wIFeef9hAhQzvRgKlSm/PtFk12HgaGtTkCMvT25YuDfa AZnoVipjl3K+5WexFojfp+rOpII8sK8FHLa1rnwgxFmv2jANcLlyXt+aptdiQoH8wt97Hc eF01f60APYyIY/78SdFYuido7OY12ao= Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4TgGXS0JWWzvVvZ; Thu, 22 Feb 2024 09:59:04 +0800 (CST) Received: from dggpemd100002.china.huawei.com (unknown [7.185.36.164]) by mail.maildlp.com (Postfix) with ESMTPS id 27EC6140153; Thu, 22 Feb 2024 10:01:07 +0800 (CST) Received: from [10.67.110.48] (10.67.110.48) by dggpemd100002.china.huawei.com (7.185.36.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.28; Thu, 22 Feb 2024 10:01:06 +0800 Message-ID: <9e5b19c7-1f57-5f19-6331-75c2cfc7800f@huawei.com> Date: Thu, 22 Feb 2024 10:01:06 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH stable] memcg: add refcnt for pcpu stock to avoid UAF problem in drain_all_stock() Content-Language: en-US To: Michal Hocko CC: , , Johannes Weiner , Roman Gushchin , Shakeel Butt , Muchun Song , , , Wang Weiyang , Xiu Jianfeng References: <20240221081801.69764-1-gongruiqi1@huawei.com> <5436af7a-26d4-7c04-466a-7163d5a26040@huawei.com> From: Gong Ruiqi In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.110.48] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemd100002.china.huawei.com (7.185.36.164) X-Rspamd-Queue-Id: 2A6F740003 X-Rspam-User: X-Stat-Signature: 5q1x6jwizpei5x6r9engskhi7515dqzp X-Rspamd-Server: rspam01 X-HE-Tag: 1708567270-689641 X-HE-Meta: U2FsdGVkX1/m8xVjha8ThI8PbamJ7NePcSWOFQgBrnr0mEZpmwA8wxBnDeLn8++1s6b5zJ/Winv39yMdvFyUEHybrXHqOXCo71r7zz69Xs/2xZ1ckpv0hGe7gIzRSZwZ3ECEzvcSiDHwxn8IxaypGXee7nwPJDgOVmSZ2grjoiOfykQB06L8rUNG/eWZqe1SMJ1bDbD3SMkttEwL3hAMPphBjOgWGx5harqLPNFIqMU9PPilSjSRQLtFPg0+YPyMZU46FhcS857xOQRM/zGF7wJFmutbtXynJJGtsIp3mLYe2KEvc+AKc+2ZTrKhsNm7d/wrA9mmd7CSIIwqUXa5FxNkj3iosv8ooM8Fl9k+qvAulDLSA1AQPbMjJYXk1u/WfcxO7X+hPkH69f+EhW3YCGuyguMoz8fblpRxy26bLqHDdnR0j8OyPbqdgmYSfO+DUcI3QnC5TiF0bv2yWO+FcMrR6r3986GovTaVSgzYtn2A86YnvuTK6o4JbIAcZ4atUk1t10WjFq5brozwg2BmTYbcLC0nNnYVIH4E1mX5QIxGrHUcQWTzs363KEqjceq/4JjUq+06tzlpNCOSMvNoEVTiV3lhtHVWw8qTJpeAXsyFgaT35pUK8txN+lkegwQtlqlgT0e2VS8SCjII77RWGIrtl2iY3vm6zUFhF/Ssk1P90x6H+bLYYnDM+whUBig8oad71kUvjluZ/e/LqfAeR2SPfaoT8QFegz5Eai7lQe9lKBjW5bRJmBxu4YqVlAXGuQOnAVURR0GUhD70JYk2sdyZiW6OfCpwAX5cWIKNdS/VZjGErRZ8mOgh1nrttk4DNTD45lUGgLArVq3VzkN9Nt7MVAo9ieAVbMtyfRzQcRFYTIN1EIRo1YNUScolHwlkTdWZwyAiiDkb4wthYlbsFyhUNdJ9wik1tgEZWQtpq2uJdgrhMApYQ81gxpxy8biChUo0IcJz7dQcMsRfbus YFNAXCzp gCj+yfM+KCNqAKhrtN+g4rR6App8Fsbz+BOQyh2YlnIaThjN8sXSPK9y4uHwhNvPlBoVeRkZ1sTIRH0Q7uOqs4E7wZWQPW6J/NHioRodjnP1GnBRJy7HDrwSD3R8wexRqND/RXYMsSAb9pCBeNjm3Fb0A1UAZAW0E6HDvU5QqkhLqOotpL+Gs087Pt5JiIN6QaEpAMK7e8hk9SnI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 2024/02/21 18:08, Michal Hocko wrote: > On Wed 21-02-24 17:50:27, Gong Ruiqi wrote: >> >> On 2024/02/21 16:38, Michal Hocko wrote: >>> On Wed 21-02-24 16:18:01, GONG, Ruiqi wrote: >>>> commit 1a3e1f40962c445b997151a542314f3c6097f8c3 upstream. >>> >>> I think it would be good to mention that this is only a partial backport >>> and also explain why to do a partial rather than the full one. >>> >> >> Okay. I think to fix this problem we should add refcnt relation between >> memcg and stock, and since higher versions have achieved this, maybe >> it's better to use the same code and align with them. So I put a "commit >> xxx upstream" here, as requested in kernel docs[1]. So yes it's a >> partial backport as we only need the stock part. > > I think it is sufficient to mention that this is a partial backport to > minimize the fix to the bare minimum. > Okay. Then I will send a v2 and add a paragraph to mention this. > [...]