Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2547593yba; Sun, 7 Apr 2019 22:37:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqw35VbAGbCN53ZTKmf6032XJJYEOkMBO/gUdU93yycMrNZxdDSydPbeHwTnNYJ+AMCTzePi X-Received: by 2002:a17:902:b191:: with SMTP id s17mr27357501plr.70.1554701847551; Sun, 07 Apr 2019 22:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554701847; cv=none; d=google.com; s=arc-20160816; b=GVZvXofwm1tdcEkMEm4SIJcwVPxieM5WPpqq+qpnNQ+6geG3eF4opzqwCVAWB16GeI +RFhbV1lS9VEj1W/jmXHz98EGHXST3I7wGfMdp/dXKm3J3XEwJCzNcBMEv120QFxbAWz T6b5icASEs1uEPQFgyOoeFQV0YVlijTFjjnKENuVyp42zNv/anet933jZ11arPp6jVMu ue9HtVA5lhUYeCaHYWXAa1kpWwH68kPkvwPARMRCJFrgQMbKDx6Rm4gZggUyPlIqZHnf DF2uqmDgCKBo+Bnz079zgtjBTOYxR9BYZLOK6V3CdaflP9GH6BNo+gmXd44ris9ZR2B7 OZLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=f+SMtvytlSiOc/cu6kg/i2uCYQdbjbuO3DZI99pciYU=; b=Pi/QanzkoyMW3+h1ZQIHQ/DcniSgK59S0bN8F1m4epN1DJHwpJByGpDeUB3ynmTLhp f/mPYTFRAFt/YOlBqaABe2PVvAN+lymLVLGJAIzaKTE0fi10CEF2nQJF7NYnj2ud/BuF jAJj7mpr0InX+zQ3tcodsS2JHYg72rQMc0+SH/1LCblDj03KGTZ2JJyzQ2t4QeNArPhn bXcH877yA3z4F2G1JJTb75+tAQCYcMLsJs+tO7rCANDy6fCOl/hHRbtqQbypu+dTNO/n g224yxHpWgCF5PHpk6N1tWIEWcO4o/01C95FYsEqkI0tcyGp6GjGYAcb1/LZA0lRlX3M 7Ykg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=UM8jkNe3; 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 67si25466142plf.222.2019.04.07.22.37.01; Sun, 07 Apr 2019 22:37:27 -0700 (PDT) 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=@linux-foundation.org header.s=google header.b=UM8jkNe3; 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 S1726369AbfDHFfy (ORCPT + 99 others); Mon, 8 Apr 2019 01:35:54 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:41492 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725877AbfDHFfy (ORCPT ); Mon, 8 Apr 2019 01:35:54 -0400 Received: by mail-lf1-f66.google.com with SMTP id 10so8457462lfr.8 for ; Sun, 07 Apr 2019 22:35:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=f+SMtvytlSiOc/cu6kg/i2uCYQdbjbuO3DZI99pciYU=; b=UM8jkNe3FivfjyjKQt0KIK00yEWIPKwCaxAzwPUf0x8n60fbSIe7PJodQN4uaQVDns 2bDMJFFS6cD4Izl7uwOyaFlSvkFQ/2MiQxr23R+3qgHyeiIoZWHrQlBibOhl6rOOls/+ FbEE0DkGCt2IM9u0wMFd7IOX0s6PcR3lvtyWQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=f+SMtvytlSiOc/cu6kg/i2uCYQdbjbuO3DZI99pciYU=; b=Hmx9mjLm9KW3HReLqp/3ZM6IN3SpDwlhoCwjq+5Upyqr53l64oxGetMV/yBkOPkbKM /1BHgh5M/QJCkisPoubX9mouXKVihwydl7dBL/aqXK/UDTplF2TmF/+lZOH6TjVVTnQn UVcXuxzpKk6B+mfpduF8DvL7yHCOZzkZkegpUmKhxNXfdDJfjYC8SYTL0m7ydl11qH5x XilHwmK1cUjkJgOYDr6XFhUPk+FoKp5pYRp+6O32kdscupr2RITjDD59fU+p5Iw4KiSP fREglvvwthwGx4GpmxuxUfMWSq25R/D6kdkSrXPs1bahNgVOfllazFnuWhm2N0Bp44/X 0qwA== X-Gm-Message-State: APjAAAUTMWqGWJPA7ES0qxQTVDifk9ZqgfI0Y7onndzS4/05PDL758kN FslKRhJgdSau1NROnGuTJHLahOEfDnQ= X-Received: by 2002:ac2:5581:: with SMTP id v1mr13726508lfg.92.1554701752018; Sun, 07 Apr 2019 22:35:52 -0700 (PDT) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com. [209.85.167.49]) by smtp.gmail.com with ESMTPSA id f15sm6270187ljm.47.2019.04.07.22.35.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Apr 2019 22:35:50 -0700 (PDT) Received: by mail-lf1-f49.google.com with SMTP id m13so8469315lfb.6 for ; Sun, 07 Apr 2019 22:35:50 -0700 (PDT) X-Received: by 2002:a19:f512:: with SMTP id j18mr9036020lfb.48.1554701750359; Sun, 07 Apr 2019 22:35:50 -0700 (PDT) MIME-Version: 1.0 References: <20190406225901.35465-1-cai@lca.pw> In-Reply-To: <20190406225901.35465-1-cai@lca.pw> From: Linus Torvalds Date: Sun, 7 Apr 2019 19:35:34 -1000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] slab: fix a crash by reading /proc/slab_allocators To: Qian Cai Cc: Andrew Morton , Christoph Lameter , penberg@kernel.org, David Rientjes , iamjoonsoo.kim@lge.com, Tejun Heo , Linux-MM , Linux List Kernel Mailing Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 6, 2019 at 12:59 PM Qian Cai wrote: > > The commit 510ded33e075 ("slab: implement slab_root_caches list") > changes the name of the list node within "struct kmem_cache" from > "list" to "root_caches_node", but leaks_show() still use the "list" > which causes a crash when reading /proc/slab_allocators. The patch does seem to be correct, and I have applied it. However, it does strike me that apparently this wasn't caught for two years. Which makes me wonder whether we should (once again) discuss just removing SLAB entirely, or at least removing the /proc/slab_allocators file. Apparently it has never been used in the last two years. At some point a "this can't have worked if anybody ever tried to use it" situation means that the code should likely be excised. Qian, how did you end up noticing and debugging this? Linus