Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp75525rdb; Wed, 21 Feb 2024 18:01:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXWMvimmHiJNUp6ubibp8YsN1rup8FBzrEZa9jW3eSEd5tFnzEcbXlX9HfPzJI/mqh+3y6tK6slTAQmHGiQwiPIwVkxxkUBhYS3xT+tMQ== X-Google-Smtp-Source: AGHT+IH2/qEshsPn9tNCsogqOIb7cgQST/lBLoa1Bty+qq9llXeQZ48U1NoBbLj0a55AFK/rJKKm X-Received: by 2002:a1f:dbc2:0:b0:4c8:ee1:5a0b with SMTP id s185-20020a1fdbc2000000b004c80ee15a0bmr9814275vkg.15.1708567282010; Wed, 21 Feb 2024 18:01:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708567281; cv=pass; d=google.com; s=arc-20160816; b=lcFj5GMQPs56ZupC5k4R6zpiLD1L9anzwIdbG4bTYYp7Lr0pvwKQkCyzAx0i+BPvcy 3ZFzNUdPn3wR9yBYz/F1T6ls/hmxbI2tif5gl0OyjPdaJjBmAKBWvalOn7Odar9A04Pl OludkkMD0bo78E1yNiK6Ui2g/wk1gpgXRXrb5himbbngS9HI2Dm/FqFJ5NmY9HkCOCJ2 /b0n3To9TqIVLtJ19vgOQiXZoyXAov2NFfDYyCAzzsqlrcDBYyyluKDrWjSyCiO4uZxK bZY41hdAe8QVtgMvKQhtWpm45BGQCubzPC4FePRWPwmzohz8uplElS9Y2kPg+/LU8PV5 RaRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=U2CjZXAFuz8xDcs/r2l9GQ555hBOcrffeDOwTIs2O9Y=; fh=h5eqhuD/5ev0UzISRggybLjXn9Bhd5MEaiEh+T+V1Lw=; b=Nmj4F3LYHfphZvndPedSVOi0oYxhMv+XviQr3jUwl7MQh7RTPy4JvovIdZOwIX4FU8 K3YSOQ/CRrrEJyyjUEZkHIxkFwNoT8dAGKPa92orZTE2Fu30jhmmRTMQj3blJWUl1ozo ps4zb++ewMz6nAo0uq84/Clf+0/vSKzDHreDOm63rw7xO10br//KgVaWq506M/PCc2Qz D24u10ABASP86VdAgGdNJcFaww/OcPZQGPO+uhOl9Mj0UWmruzNxeqyCIwkpaMnFCdF0 q4sCC0PVKGwkv+DVdm/lnQ/gUQE/6e2mWWHeeePAnazzRwvb8P5vicE1bJRtQERA3XQu fWjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-75779-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75779-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l198-20020a1ffecf000000b004c839338ad2si1563936vki.99.2024.02.21.18.01.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 18:01:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75779-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-75779-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75779-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BB8511C219CC for ; Thu, 22 Feb 2024 02:01:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 865A51428E; Thu, 22 Feb 2024 02:01:13 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38AA611CBE; Thu, 22 Feb 2024 02:01:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708567273; cv=none; b=ToHCEXpgsmVWcVoEJY3lWlSbvaLimNIca1s2nvDR6Y8Fz0ei8uQkrDVIBdo61PeEwnpGfw/rTIMdsMpR9LyQ2lXme3WzF4kvM3DIeH1/pZZoArmWm5ocLbS1zwdr9UgYDb6oF6BwHL0HcZZ3sm5XAMB45D0kAi73cf5T174kXv8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708567273; c=relaxed/simple; bh=FxBxQvpWr/t/SMgs/1y6sJ0MS8oWk0441mgO3fJ+kdY=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=Nl/cc/yexrdKmBFcB8SVCjoutsR8CxsZX5u7iIgyhe+6bOO2wBeq/tNdYY3Vb2NazIOedpsyUjux63JM2lS8Sm0A7HY1k5U9Qb3hPpYBUgu+tjSF0qgzB81lNltx8nsVPPDIgft9YSndfC1SZV9AdB4CcBW+b/qyaS2nvpuZlFs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemd100002.china.huawei.com (7.185.36.164) 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. > [...]