Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2270887rdb; Wed, 21 Feb 2024 02:23:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVirDTP0JRIChOXDNHlmvaVQkvamecwQai9foPyroL7ElSmnFDKXv1bkCdAKbjzt61KL0ZshGFco7M9KTIDTxfdCrE28V2yPkOjsPqHQA== X-Google-Smtp-Source: AGHT+IHcPaJe6cDt9Oc96RblJtwcSfg/XFQ2FUSQW392W/nzSslVFHcqO6c9T0+BJJaM7nrjkDzV X-Received: by 2002:a17:902:d50b:b0:1db:dd05:a1de with SMTP id b11-20020a170902d50b00b001dbdd05a1demr12250554plg.24.1708510999778; Wed, 21 Feb 2024 02:23:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708510999; cv=pass; d=google.com; s=arc-20160816; b=Hgu7vbw84HKviPLOWjAlpsz10nf9s+d3Vl7NoC8Raq3grcWIQYJU2EMVszLs4H5ikI smdvxK8oqxjH1wXy5fw4uQpWesbq/yxzXVWsl1ZSiUCDFi7/nS3sGwvg1QIdyU7DAjx0 cQ9i3rjLxZ+nBz93N/9VQcCASo7B+FZHbjjGoVAolEhahN97AO+6Eh8v4FV618m2ywAh fR6TIiz6R6B0xfzjh+/q+tIk9EWttbqXSWAerejM15R3+KakarJnzY/+H5ySWdps/uYV Zjb21rL9fmf+6GWWNeDP2c05MLO3jG+pOPc984useqtnszFZGIFdQ3CWyalSHfSfXNOG 06hA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=JUQXQbWJgELZMgcNLwzkaVchD+3Rj5s227haqHX0N/s=; fh=15Aolu+jmjO2eno1qO5NYfbBO3ogvzu2aVn/g5KqOtU=; b=tkWkpdosFQbzauXitXoiSt4KqGWgakIoyt4WvYVhk9ohJLWXT8R3SYppKk7EDb1oLN qtSX2CL/AKXvbi6p+9tAX/lcySBe74xZEyrz4vSm6wsHDumLLnVVUUT8LSsytCs9VE1y IFzxv2IqWQfG6soecW5W27YaFm42tpFZBKKaGmzd25HnPh2dIEMKvPk/mq3NFujT5bQo CLlZ61ZaZ7OclqDQpEhm5bJWUBm+Do4F26dfe7+CODT3okIK4KWCiMde2GsHn8sHhArh oNs0Zy+ped++0ed5Vkd1nb0FYOxOvd6tD9olMPL1/+e7T3r3YVQLkHCYx1Ge62EaoWd7 K35g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=WJvTciW+; dkim=pass header.i=@suse.com header.s=susede1 header.b=WJvTciW+; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-74516-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74516-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id mb8-20020a170903098800b001dbaaecde1bsi8240712plb.530.2024.02.21.02.23.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 02:23:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74516-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=WJvTciW+; dkim=pass header.i=@suse.com header.s=susede1 header.b=WJvTciW+; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-74516-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74516-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 30E5FB234DE for ; Wed, 21 Feb 2024 10:22:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E47D93DB97; Wed, 21 Feb 2024 10:22:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="WJvTciW+"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="WJvTciW+" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 5F23D3D96B; Wed, 21 Feb 2024 10:22:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708510948; cv=none; b=EtCChpGkit9qPMub8M7TNnYADRAyLeMKZCJ9H82tpLfV/dzJcInkiZgMt9hRHqTODbo11lmQa3Yd3QMldhNvC0R1pTk5o4EBPykZCh4V/5dXieRgxRgJIpeeA0f9R8bkKIzsSbE/NhFvKWkSqUEwm+5uKzwMdetsegfFOSGoTKI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708510948; c=relaxed/simple; bh=mL+kprjzT51esIJmHGVmrkTR6renHmueE7JLTXsvRow=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=moW1qosDG4oW2yy7iAQ8Zs+hiKuY0iggw2xuGY9tAdHSGQF9RZit7Kwid5Qq4MB2+zu59zNAcIORLzK8N4v2K4+p0lKdU1D7sL6ttAzJ+Cer1fSp59dPJKfnutx/JCL+5Kh4I2tgRuqImQS3J8h/UBAztIVz0cOnRQIiNLH6dD0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=WJvTciW+; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=WJvTciW+; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 865FD1FB4E; Wed, 21 Feb 2024 10:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1708510944; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JUQXQbWJgELZMgcNLwzkaVchD+3Rj5s227haqHX0N/s=; b=WJvTciW+etvqI61sZ2YON21tndWkWqxdlXhMC1CzDAlJWk8l1QG4fhrkXb6u9LQ5ewo9Eo nKhqOBvylDd8dLQtbbZOZsXWJoUSDa0s/MHEKCPB/TBjtX8nlrkIQb/Kn5OEjNoUWPdA8w wECuTljBPVjTe8xoXGJkuolbzTR2xb0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1708510944; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JUQXQbWJgELZMgcNLwzkaVchD+3Rj5s227haqHX0N/s=; b=WJvTciW+etvqI61sZ2YON21tndWkWqxdlXhMC1CzDAlJWk8l1QG4fhrkXb6u9LQ5ewo9Eo nKhqOBvylDd8dLQtbbZOZsXWJoUSDa0s/MHEKCPB/TBjtX8nlrkIQb/Kn5OEjNoUWPdA8w wECuTljBPVjTe8xoXGJkuolbzTR2xb0= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6933E13A69; Wed, 21 Feb 2024 10:22:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id gcG0FuDO1WV9RAAAD6G6ig (envelope-from ); Wed, 21 Feb 2024 10:22:24 +0000 Date: Wed, 21 Feb 2024 11:22:23 +0100 From: Michal Hocko To: Gong Ruiqi Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Johannes Weiner , Roman Gushchin , Shakeel Butt , Muchun Song , cgroups@vger.kernel.org, linux-mm@kvack.org, Wang Weiyang , Xiu Jianfeng Subject: Re: [PATCH stable] memcg: add refcnt for pcpu stock to avoid UAF problem in drain_all_stock() Message-ID: References: <20240221081801.69764-1-gongruiqi1@huawei.com> <5436af7a-26d4-7c04-466a-7163d5a26040@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=WJvTciW+ X-Spamd-Result: default: False [-1.93 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DKIM_TRACE(0.00)[suse.com:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_SEVEN(0.00)[11]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-2.12)[95.77%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 865FD1FB4E X-Spam-Level: X-Spam-Score: -1.93 X-Spam-Flag: NO On Wed 21-02-24 11:08:02, Michal Hocko wrote: [...] > You are right. Thanks! IRQ disabling is there in one form or the other > since db2ba40c277d ("mm: memcontrol: make per-cpu charge cache IRQ-safe > for socket accounting") so 4.8+ is safe. Backports to older kernels > would nee to pull this one as well. Scratch that. Prior to db2ba40c277d, we used to disable preemption via {get,put}_cpu_var and that should achive the same result. -- Michal Hocko SUSE Labs