Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1235499pxb; Thu, 23 Sep 2021 23:06:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0Xi2W9KdGsuI/WoJTLyCqpi69fo2opSDLDOlsQ17VA4WYfiTBMchOfjnyVbdCM5j7AsG8 X-Received: by 2002:a05:6638:16d4:: with SMTP id g20mr7701887jat.22.1632463615754; Thu, 23 Sep 2021 23:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632463615; cv=none; d=google.com; s=arc-20160816; b=erpOFKSl4pX8vAWg5id+7/IMC+OeIUo5RW1xq8usJQSfrG/XG3Tn+xLTwziaj+AWpp xQHAXos4ty5RKrJqX7H0F3g3D1l5cY8hnlhL/GOgHxRUpupMyQNeQbrAimKohDdPOqdU fKtsr96rzRVicyRv1DQELegatEEXUulRJ+lvo7ZqbWQQnr4xiA0JgdGXlgqP1V3jJlwU iDp7fHSsED9t1vwxlCIeyVkVVXlUqn9NPcJJeESZPpJa1xjrAFM8HFh3z/sNrpyieqgk //6LNjBVRfvBE/mmdkuWX6rMeH01iiTe/nZXD/JPmYalvgVH9pz28Pxcm4CAzMiMeuN+ hzuA== 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=URcHuUR3KotXWwoDq/T1fdJ+3yW74lFiMCYEJPpK4uY=; b=e1tcTXB0F/OdL87uAqTWa0rAHh2odu7bobv31mwxzXUuLq/EIYxcAOuIqChoCB+/Ab vwZYf+B1+ZyaVkuqUZ9jjHKiEchp9ep5EGmrvvAKXxK4DgoIlLk4s7XlMnTZoMc8eTKj P3ulnTgNAPyRcdT4+2VfUXoTyWl2GLZrh+Uv1kTqi4DtKOBbVe+actI/KO3TwGzaVhCp nfGxlBBvUUDT3OWWgtIhw1ctYvl26LrHMZTEM8X76XAaWm5GLukxSTilH+GkZV5v41ix +XSbtRhZ44Er1XeyTcvv3AxSnGCgUAsnWZDDDg/z7bmV3x3TK4UH0FAaOsZ5RzFYjYQ1 JcMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kkL7so1Z; 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 u7si8791894jae.78.2021.09.23.23.06.43; Thu, 23 Sep 2021 23:06:55 -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=kkL7so1Z; 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 S244161AbhIXGFr (ORCPT + 99 others); Fri, 24 Sep 2021 02:05:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244141AbhIXGFq (ORCPT ); Fri, 24 Sep 2021 02:05:46 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F49AC061756 for ; Thu, 23 Sep 2021 23:04:14 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id d13-20020a17090ad3cd00b0019e746f7bd4so3620550pjw.0 for ; Thu, 23 Sep 2021 23:04:14 -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=URcHuUR3KotXWwoDq/T1fdJ+3yW74lFiMCYEJPpK4uY=; b=kkL7so1ZIJloVpLtCNdL0ilz3NYV+bsAJuKzXwcT7agbHZTVwHPoOIWXSsZwuczcyv ayHqCRfDVveUm8N8NzR4Z91wlWa5e6IukAXGZF0mIkYQ7cexCZ7uCVGBYLQVpbiNyxog HVIjOw9Gn1Lh1ZsHG0ILF1oKPyv/TUwq1g7rg= 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=URcHuUR3KotXWwoDq/T1fdJ+3yW74lFiMCYEJPpK4uY=; b=v/CYKDfpoNWiAtH/76yo0Y9EVXgu8ZHixr6Z84V1uBxfSN4R7yd8qE4G8UzMXldxW9 lmQlSCZgZN16h7vw5t3N8i/rA7J8BBvEGo1Tg+eu4m1CdgOFYDvtHLVjR1l0yZrkit3i epLnsKiNnx6xoqjyDbUnm+fmAyEykls3QLKW5DaV3XBfwc0zkE4wQMkf8BCL/FFyLBVr dog8gMYyXbxsZp9qsd89wYIF1TcWZG39575PeGxwaxYVMO7T65EgZjltOXL84Z7mr03T +ugEGhEc7RLPyY5KiZeLW2p5gakNZRrl0jEmSXuXNZT7yUVDkYeRV0mn0g1FiIgdJ2uT aScQ== X-Gm-Message-State: AOAM530EzDscdMxQSbaMHd6+IexMTbzLiDzBjrROF2FgAtDJoOaCTbUY HxxN4OX9sBkKdrbdV8L4B6RtgQ== X-Received: by 2002:a17:90b:3901:: with SMTP id ob1mr201990pjb.136.1632463453532; Thu, 23 Sep 2021 23:04:13 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id t22sm680585pgb.77.2021.09.23.23.04.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Sep 2021 23:04:12 -0700 (PDT) Date: Thu, 23 Sep 2021 23:04:11 -0700 From: Kees Cook To: Andrew Morton 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 , "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: <202109232301.B0B9753D@keescook> References: <20210923233105.4045080-1-keescook@chromium.org> <20210923191306.664d39866761778a4a6ea56c@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210923191306.664d39866761778a4a6ea56c@linux-foundation.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 23, 2021 at 07:13:06PM -0700, Andrew Morton wrote: > On Thu, 23 Sep 2021 16:31:05 -0700 Kees Cook wrote: > > > The /proc/$pid/wchan file has been broken by default on x86_64 for 4 > > years now[1]. > > [1] is hard to decrypt. I think it would be better if this changelog > were to describe the problem directly, completely and succinctly? > > > 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. > > > > This leaves kernel/sched/fair.c as the only user of get_wchan(). But > > again, since this was broken for 4 years, was this profiling logic > > actually doing anything useful? > > Agree that returning a hard-wired "0\n" is the way to go. I must NAK my own patch. ;) It looks like this would be a breaking userspace-visible change[1]. We need to fix the two bugs though: 1) wchan broken under ORC (patch exists in the thread at [1]) 2) wchan leaking raw addresses (152c432b128c needs reverting from v5.12 and later) -Kees [1] https://lore.kernel.org/lkml/20210924054647.v6x6risoa4jhuu6s@shells.gnugeneration.com -- Kees Cook