Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp534356pxb; Thu, 30 Sep 2021 11:13:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/LE/eBLZavbzQIYXNVAX9MYDDsQgupYng+ull7qomjLHCCiF94FFnLmrtdCzsWBYgdroz X-Received: by 2002:a05:6a00:98b:b0:44b:df34:c17b with SMTP id u11-20020a056a00098b00b0044bdf34c17bmr5690593pfg.34.1633025622597; Thu, 30 Sep 2021 11:13:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633025622; cv=none; d=google.com; s=arc-20160816; b=liQdXtEbO0rNNO4HHg0hcVtuh7Fbi8HkiSl2I1AaN6u+0D+A6612FKsijsmBP62CXl e7NGE8/m+48p0v7xzGSEbfVaI5mapE+2eo9pV8ky4Pj7JrzA5Bm4F8XYLW9qjNNb9EB2 1YfB1e3MWlT60uNM9WtJaTMZ9MbEm8zAfKmydfMS1Ud8kJYcooQ4+JuMr9GcsPy4mQCE xJs/gVqHpiZRE8egSHTDyeLDPONp9CX9vya5JlOBondaZneCaqKXH4wK/LhI+ZkHX15J E0K8tOuI0L/V6SacyPZajAEvlDsv55jgWtNZX+dnRnHMGgiIxz6L+GN84pUTcu0TrPx2 BWjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/jP68Qb3IOmFZtyBmCWtI8sRKP1bO4xuJlNxJXxFMLo=; b=GsrITo+HkuvcKapIjEsrvVf3ee+k8/C/qh5zgTPs2aj7uU0tAKR2R+lHiQPyS+uPHG 3bmjC1Y6Qrcq1R5ymWScc84fDtkIX9b2sHNKFk1tjY9s3rOGyz3FIMrdvgXMfPPrmeGr JStcjBUzaxzOa0hBjDPjxTzvICatiaoGERLSE74waQmp41uPa2IdkfVqbmYM6YxsvUID sGY4D6MkPlR5aDsLNzh7CvCcLRbVNVfg3QklG6NJqnco8BTDlBYAcX9lqWPwnsD03gSF hL4BsZXCwwH423AMdXGoFwPQS4s2nYcWpjeTkUJRbPyZu/I4vitVbCBrhttiOQh+YNxb 61gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eEsa6HUQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 128si4147323pgc.33.2021.09.30.11.13.25; Thu, 30 Sep 2021 11:13:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eEsa6HUQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353203AbhI3SOS (ORCPT + 99 others); Thu, 30 Sep 2021 14:14:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353205AbhI3SOP (ORCPT ); Thu, 30 Sep 2021 14:14:15 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F996C06176D for ; Thu, 30 Sep 2021 11:12:32 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id t4so4658530plo.0 for ; Thu, 30 Sep 2021 11:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/jP68Qb3IOmFZtyBmCWtI8sRKP1bO4xuJlNxJXxFMLo=; b=eEsa6HUQ1ug8JocDGdLB7jS8rTRNf4nqyY/oodN6m4TktfoLZ4ty8Nb+FwT5sZ/zkF sMO73naAZDcBp4UQBX3l3Wunm9J9cMJrljTMO5D0Ch/WSk8j2E+ZZ5dpjxsFahZZewX3 mPfNaddSe5vK2Ko8GUCIHmjLbKcAxLL058uts= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/jP68Qb3IOmFZtyBmCWtI8sRKP1bO4xuJlNxJXxFMLo=; b=fei9YTFS1UWwG64g/kIgqOS9nGQmJUAU5/69d6wYGgBncFJu8lOHuJKoOjZ4pgU/fg AEL0EKGVBNb+S5/9A1g4AFHEB4XZQbvCBef2GPrmW3ja6M5cCm3VdEQq2aYopbhaw+jU ew3M7AgwVLgx/SbwSjlkIneXWhqLSbAZdyRGjedDYJ8JFsXO/dRZPCMl6SI6jn7YivjB awxQSOnP3I+UAiOM++vx8VXRG+fqkYs13dTHzo4pn68OPRKa5utCei8OiYXuQIiggNCp X1OvGKRUsDZiBYiTeh3tnTLKcHZpYJvyEtdviRjCAXjevSBhZx7u++ienUU7Y8rQRL09 F1Ug== X-Gm-Message-State: AOAM533Y2SVrhYI+r3m/Ak9qhsAZL37IWsdSdGSaDDkc9+A6INy8Ibne 5ChYVpdqL2vcLacytdlseskpbw== X-Received: by 2002:a17:902:b193:b029:11a:a179:453a with SMTP id s19-20020a170902b193b029011aa179453amr5469195plr.69.1633025551776; Thu, 30 Sep 2021 11:12:31 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id o3sm5391243pjq.34.2021.09.30.11.12.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 11:12:31 -0700 (PDT) Date: Thu, 30 Sep 2021 11:12:30 -0700 From: Kees Cook To: Stephen Brennan Cc: Thomas Gleixner , Josh Poimboeuf , Vito Caputo , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Jens Axboe , Mark Rutland , Peter Zijlstra , Stefan Metzmacher , Andy Lutomirski , Lai Jiangshan , Christian Brauner , Andrew Morton , "Kenta.Tada@sony.com" , Daniel Bristot de Oliveira , Michael =?iso-8859-1?Q?Wei=DF?= , Anand K Mistry , Alexey Gladkov , Michal Hocko , Helge Deller , Dave Hansen , Andrea Righi , Ohhoon Kwon , Kalesh Singh , YiFei Zhu , "Eric W. Biederman" , linux-kernel@vger.kernel.org, x86@kernel.org, linux-fsdevel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] proc: Disable /proc/$pid/wchan Message-ID: <202109301109.4E172219@keescook> References: <20210923233105.4045080-1-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 30, 2021 at 11:05:35AM -0700, Stephen Brennan wrote: > On 9/23/21 4:31 PM, Kees Cook wrote: > > The /proc/$pid/wchan file has been broken by default on x86_64 for 4 > > years now[1]. As this remains a potential leak of either kernel > > addresses (when symbolization fails) or limited observation of kernel > > function progress, just remove the contents for good. > > > > Unconditionally set the contents to "0" and also mark the wchan > > field in /proc/$pid/stat with 0. > > Hi all, > > It looks like there's already been pushback on this idea, but I wanted > to add another voice from a frequent user of /proc/$pid/wchan (via PS). > Much of my job involves diagnosing kernel issues and performance issues > on stable kernels, frequently on production systems where I can't do > anything too invasive. wchan is incredibly useful for these situations, > so much so that we store regular snapshots of ps output, and we expand > the size of the WCHAN column to fit more data (e.g. ps -e -o > pid,wchan=WCHAN-WIDE-COLUMN). Disabling wchan would remove a critical > tool for me and my team. Thanks for speaking up! Yes, we've moved to fixing wchan correctly as it's clear it's still very much in use. :) Current thread is here: https://lore.kernel.org/lkml/20210929220218.691419-1-keescook@chromium.org/ -- Kees Cook