Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4518362ybf; Wed, 4 Mar 2020 05:37:12 -0800 (PST) X-Google-Smtp-Source: ADFU+vtWA/rlNQ8nh4IZ82Yp+XHNvg77NFKpLU+e5QrPr+fKcIVuexxRgZMXX3+C11Iqc/2AcKCE X-Received: by 2002:aca:3354:: with SMTP id z81mr1766475oiz.129.1583329031855; Wed, 04 Mar 2020 05:37:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583329031; cv=none; d=google.com; s=arc-20160816; b=xJ7aJQoj2tiKWjfElXTdw9PaxgAv4kq6F3maTx1O5hjBdbloj0dyQtjLomyaki7XPx XfLvGAXdzmPYEANThS/OLl00y5LiItZS5bGMoRVtya355QL07O8T+fXONuHW/ytaCP/b QpCiTcld6CGmgLcRQ8pTxzvOwczjkyu0ElmNJCWgddLxRYJkOd4pXJBFjftNGRcCBPoA hpMEo9O5l1NMHsWH56QML6l7Hf+LXMfp0Eemy0avrxBI3NC4w0eGPwTcrRuWCbEKeV+n IXb0eDmMHyxk2ZV2RXCfSrkZBgMmXIWW6GeJVsfNIjF5wFscnAuwRyag449liEm1cedz frzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=mpYEiYRocka7ATrbRk79a6a7IumZgblHI2WLdpIhwgE=; b=FqTlkiY2feKqrYOkyzPfOXaIrQkYG55Xn4MWbq8FJuEnaQWQmKpSjFEdpQ7JNldiav Mp+fcmgNGUDg8H3Wwd9+8jemyo49mkmzc58FjqKwfJD68Fm5Hq1Z9mLlV9Ml6cme9OZN S6Jp5BgyJ/Uk71xIeOEJMyww844zlVUcVQWzvY/PwmipNERg71ovG5N1LhzYXYPp88wW jA1AWze6J+R9Kb6+n1rklWwRbWXk9Qrlqvgm9BqOg751trANRF9EYhR0+B9Al91soOhf QC5rbgU0sIhSi00KswU+4btDIUw2NeHOLdZ873gIguyTsI+yL6NaKxDt+hlPSnXjJon+ YYAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=KRMhg3xa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1si1059704otn.150.2020.03.04.05.37.00; Wed, 04 Mar 2020 05:37:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=KRMhg3xa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729386AbgCDNgu (ORCPT + 99 others); Wed, 4 Mar 2020 08:36:50 -0500 Received: from mail-qk1-f195.google.com ([209.85.222.195]:33090 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728451AbgCDNgu (ORCPT ); Wed, 4 Mar 2020 08:36:50 -0500 Received: by mail-qk1-f195.google.com with SMTP id p62so1584775qkb.0 for ; Wed, 04 Mar 2020 05:36:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=mpYEiYRocka7ATrbRk79a6a7IumZgblHI2WLdpIhwgE=; b=KRMhg3xagLh3UMJC+uZmNRJhAvbb7+lGITFZ6oXEJ30imCsJOA2C8r3Gx1xSeoh0lb u03uyVzA7OaXsX0ecbqGS+TRSALv/m+efBvYRWRK4sQZPqEj/fTrv1B7Pmq325DuD5NW cMufP88PsLaQcCfoDSfv4BPWYvqoVkNYsnhvMkNnX4TuvZd59E+SOYv2wK4k/hxlGpDg A2arqwo0nTy1v+8iaOoMpOA01VAURb/SRsABLzydqTmYAeuDo7DyVz1SfDuQwfpnTmhO X6UJVLROabbZPV6y+CIAT7vCViW9RJcXYUBynLPR36HFNmVikISKGdk38i/5pQf6o5CQ /2HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=mpYEiYRocka7ATrbRk79a6a7IumZgblHI2WLdpIhwgE=; b=Rjuy/1OTjVIjE7OnIWos4PLUqITebJjKmS+4Lz1MgnP+SRs1lwU769KVWcCcgin4lc DtXhc61Yo37asG+olHKPCGfs+zq7efwvFJQXlcEEJd56/jc8Z6LJXsM0iAuWAqRcZYHQ xavX3vNXbOf6aE7wl6FNjnYd3GpiI3HBstckQh8XLjVCKweA/BiOX8TpwsEQgCidYWWf sDptpI2vR9M0MdgZ6gWcnoUN9U6TYxncHqH4oJnFA7UNAbmpwkKPSLgJcDF6J7aVLyGB mpL9aP6zPivJqLFAEHok+xWBUlD1+uvfDUafh6XcQ08ZVMaN2xyh+w2tprjPh/mMjZXZ TvbA== X-Gm-Message-State: ANhLgQ1/rRxB/eS/d1lQtG64dEetl5vxu5XYlNaGbJA1Z/Zu72DASw2t qxno80cFoF8zaETGwbb62siszA== X-Received: by 2002:a05:620a:2224:: with SMTP id n4mr2787662qkh.21.1583329009507; Wed, 04 Mar 2020 05:36:49 -0800 (PST) Received: from dhcp-41-57.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id k5sm1492991qte.25.2020.03.04.05.36.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2020 05:36:48 -0800 (PST) Message-ID: <1583329007.7365.151.camel@lca.pw> Subject: Re: [PATCH] cgroup: fix psi_show() crash on 32bit ino archs From: Qian Cai To: Johannes Weiner Cc: tj@kernel.org, lizefan@huawei.com, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 04 Mar 2020 08:36:47 -0500 In-Reply-To: <20200224162906.GB1674@cmpxchg.org> References: <20200224030007.3990-1-cai@lca.pw> <20200224162906.GB1674@cmpxchg.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-02-24 at 11:29 -0500, Johannes Weiner wrote: > On Sun, Feb 23, 2020 at 10:00:07PM -0500, Qian Cai wrote: > > Similar to the commit d7495343228f ("cgroup: fix incorrect > > WARN_ON_ONCE() in cgroup_setup_root()"), cgroup_id(root_cgrp) does not > > equal to 1 on 32bit ino archs which triggers all sorts of issues with > > psi_show() on s390x. For example, > > > > BUG: KASAN: slab-out-of-bounds in collect_percpu_times+0x2d0/ > > Read of size 4 at addr 000000001e0ce000 by task read_all/3667 > > collect_percpu_times+0x2d0/0x798 > > psi_show+0x7c/0x2a8 > > seq_read+0x2ac/0x830 > > vfs_read+0x92/0x150 > > ksys_read+0xe2/0x188 > > system_call+0xd8/0x2b4 > > > > Fix it by using cgroup_ino(). > > > > Fixes: 743210386c03 ("cgroup: use cgrp->kn->id as the cgroup ID") > > Signed-off-by: Qian Cai > > Acked-by: Johannes Weiner Tejun, can you take a look at this when you had a chance?