Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2620702ybv; Mon, 24 Feb 2020 08:30:30 -0800 (PST) X-Google-Smtp-Source: APXvYqzziDpvZR0S299lKaDgyeoYTNvTy5oBLtmRaJxnYPNNrzJiIOBZ3Vc0Sj4BZ6Hy9pkPMSqb X-Received: by 2002:a05:6808:9ba:: with SMTP id e26mr13292479oig.81.1582561830075; Mon, 24 Feb 2020 08:30:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582561830; cv=none; d=google.com; s=arc-20160816; b=GRDmyktXtDdh5cbnMFyoikj/KX53LZoTNV1j3mT3E07rOS+XcqyT4trLNYM2P2yEjk nYkjs8NBBNmJj/WJmSJsy40ekILeR9dAZcuL7+zgiPifqz9yusM78vYYrdVrGUtp5Oej bqdiwFFE6HdIqWymGIBFZXvLmri017Oyv8GHv2B2Nh4MYvmESLxncq3k4uLHvUKu9VBt PSPbPpQuuGk/oXe7C2q7Jsju0WLj8UzLmsyW1fRKaJ+fUjfSXaXslch9pgZNQ018SABc dHdbJuGyP70Bx6AI5q5lZVeou79UIODAd4rk/u00LwS2Jw1IntfMBRD6zXlOuJ/j2hBm mWNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ayL/a+KEUEgG8kUr32wkz/zkDzUV2JeP3xXHo8B3UmY=; b=EnEu0ouW69sdkMrAafi7rBGVDiTOzzNOsr8cgY3qvEZXOQ4Gh0uRaloXiPo2XsNoc4 P+ZRFJVrHtQR5hWGEcUZZcSFA9FsPh/9XRXghdGJT46zmGYPlln81SG64ikEWBrRJL9Y qqpPuJW90jL2DAYkj1VUwlm34zNuX4VSmmt/uDdQPyA2uyYhuD9q1wWSlZWRsIGa+eE/ 6aYbn2VH/SxIHl3JXJ44crbtl7pW0o5uPXQxOf7SZ4qdl8mpjL64LRK41cCmiVZw5Rcj Om2l2/zJPJaTvQTzYhJhysFi/cSQpjm37uHAyEk+sUgWrOkiOUAK4O3aAVg/+5nB3XcZ Kf5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=H70cCu9p; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si5943754oth.15.2020.02.24.08.30.17; Mon, 24 Feb 2020 08:30:30 -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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=H70cCu9p; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727750AbgBXQ3J (ORCPT + 99 others); Mon, 24 Feb 2020 11:29:09 -0500 Received: from mail-qv1-f67.google.com ([209.85.219.67]:33378 "EHLO mail-qv1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727299AbgBXQ3J (ORCPT ); Mon, 24 Feb 2020 11:29:09 -0500 Received: by mail-qv1-f67.google.com with SMTP id ek2so4399166qvb.0 for ; Mon, 24 Feb 2020 08:29:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ayL/a+KEUEgG8kUr32wkz/zkDzUV2JeP3xXHo8B3UmY=; b=H70cCu9pyk/xG3LyHYdYjgRM9JXlOdn+iavwajhfdD56D1QKqyTUIY2WkWWtme6T0R X0EtycCQX0mfKuXRA6ip6+B1shl+Y6MAmt8aVaNkw+P3d2QwiRZOY4VAilSFo2tH6GIQ 8uEVQQOlAQDRDWY2xyGEK8Q0x9rigYd6AkhIDBvgupLxMxT8V29iDdKekTkoNVIIZNPd 7015RAXtidGAd5WyQQRSIZmwrkqDA9hCTOs1MQAWoZxLPA70GcMdUahyXRINEk0eQgq/ 9IVdQi0vJuUcoWegqbsfRr+0WWwFJ+hfJsYJI+qic+gun0s6YEN3aVVEXUYixc8DAe2r K4cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ayL/a+KEUEgG8kUr32wkz/zkDzUV2JeP3xXHo8B3UmY=; b=JyrN9sdm5dV0N91Z/1AhP7JfRe1krOgUin1mvjcriQNd9n7v4MysW/Xn4iFEpWryG/ TWQrEZeUdJiwLpAd1M0TjYwoc9+uABT1alYqPSxDG68u5aMFTmmicDh7ogP6Gfhweg9X 6CnOYrEwzuidA1wML7rRXKGoz7H6XGj5kO3QsLnzR9GYDFPEdTmvm3ZIO+UfJ9t1cw5e +y4W8i+7jKdbYfWNlfC//RmXXqrDOWCQm6FSM10Py3zXb2X4pGOkpgh6vDGUSaAnea+8 YyIh7jN39cfujUyrdVyBWwpwf01U32r0Q9INr+dWfg5T67f/ayDlAh54FpJaLpXa0pTg VpBQ== X-Gm-Message-State: APjAAAV+V30BoquT1riS+9rVwoGlFNMPJDyrjRC6+ViXL7/CNjxnxFMu cJCOiN/VkfVC02QeHtoEvniAJw== X-Received: by 2002:a0c:ed32:: with SMTP id u18mr45645692qvq.2.1582561748197; Mon, 24 Feb 2020 08:29:08 -0800 (PST) Received: from localhost ([2620:10d:c091:500::1:e64b]) by smtp.gmail.com with ESMTPSA id y91sm6291011qtd.13.2020.02.24.08.29.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 08:29:07 -0800 (PST) Date: Mon, 24 Feb 2020 11:29:06 -0500 From: Johannes Weiner To: Qian Cai Cc: tj@kernel.org, lizefan@huawei.com, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cgroup: fix psi_show() crash on 32bit ino archs Message-ID: <20200224162906.GB1674@cmpxchg.org> References: <20200224030007.3990-1-cai@lca.pw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200224030007.3990-1-cai@lca.pw> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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