Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4186211pxb; Mon, 27 Sep 2021 11:09:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5PW14RDrC3KMZNrcbnM2d7S+OtzWyiItNguBWIyV7PPN424Mz+jH7SGTSNOGhXuHlGwxw X-Received: by 2002:a17:906:278f:: with SMTP id j15mr1585887ejc.202.1632766184068; Mon, 27 Sep 2021 11:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632766184; cv=none; d=google.com; s=arc-20160816; b=sUl7aqUbXPoy7saxOjiPLeGb0+Sh9pH3jrdnscpClOfx9E5xy4BykdEXfsLejKo5oz U/mhpZP7EzbXTjf67OsjsmyWGiEXPpVsxD9lT3c1vnpvZAniULDmMYubv+udgV7vwZpG IP3vOCYHwcPpG8/lNDwfT47OnYXuKjoDUHWjbc/C6Y0kVA5FoxmWbturvsz8aYLeYMuy e4dE46VXwbiAMDyxmmwLyR1ccU4Sc+uASWASa3b7fyam5SJsG7TiAtYWjJTJDX4dAHbf p8gLCfYyKqQ+JOJh0z3E6DP3JG2ODPbj/tv2R7IJQtL7uYUtp0oPlNZHkpeRhTvoaUYW ueFg== 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=tDOkVE0ODQlIfy+svH+8qmYmMfJw/SIE05I5QEmJTc0=; b=LHfCGA6mqO0sSIXbAlnJ/uPdz9MujUuyvyc1R6V1l4es2v6Gs3T8rm22rQ+P2ebg4E nGV16gjReDK+9USRlW4HgeAxaGgdjB5gG8YhHRb3ZdqhhVzBZCOKXotwshS5Aww/ws2p SFqI1ZjXF0cfdQO8hdmKru7Q0oKyS1ZxsHa8pk7e+8WorJfoDTt4E8C+VkrAcljiNViE Fm/3vzzFYCePH4iWC/z5Rfy0Q3o6Jy9VwKM6ladqj/B0BfX3CV+HUE4cJNv1OT9d6vno SvlIGUjkXqYlqvO/NfSSHwKnGqQdhp9PhSqPG8CekFZ4EKZ9Yh/+i63q0DVqx0OcnlFe imxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=H4dtikHl; 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 r24si2877504edi.292.2021.09.27.11.08.57; Mon, 27 Sep 2021 11:09:44 -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=H4dtikHl; 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 S235904AbhI0SJK (ORCPT + 99 others); Mon, 27 Sep 2021 14:09:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235908AbhI0SJI (ORCPT ); Mon, 27 Sep 2021 14:09:08 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15285C061714 for ; Mon, 27 Sep 2021 11:07:30 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id l6so12322063plh.9 for ; Mon, 27 Sep 2021 11:07:30 -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=tDOkVE0ODQlIfy+svH+8qmYmMfJw/SIE05I5QEmJTc0=; b=H4dtikHlIIRNu9x+nUBJ94yto7vmTPkWR8JrJ3hOvt1/U8BGZ1N+m4tQCt4tF9CT6s KpBUabpeYdk1Chi60PLSpsc4rxh7sfO9oGE7bCVcww60FrgVvM3lqnRYX/BB1vMyaS8P RH2fGw80AQ/rrLC9fW8ALjrP/aLT93HUL5bQI= 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=tDOkVE0ODQlIfy+svH+8qmYmMfJw/SIE05I5QEmJTc0=; b=kLHOTELYXpreC3JknkOwsUyooMffIANnH2ZIPGanjC8ko8Hu89+3WhYFZNHZEy+5P6 68V4WDliydtJmS2RPvlSzzoRXiVC9iWUyj1kCsWtShT8BvjS1iAorjHNzweXsh+Jm3Sf +0a1kieS1bvvqS9OTHd6YsRXA2GgqgTB+MyI6QO6BSbp5zoBXJoy41rbOV5fxAQzXk1A o6l3K101igqJQAPXAbhm/LZYc0D8iU4jL2QKmhSarzE9wIsgJHpLH56q3XCKDfez02Qo 2SvghO1YPhs6xMBYToGNDJCcXUDx7g2YTlLKzExX/z/5pO6Hlx+Gh3vl3KYyzrN3ukR2 YRLg== X-Gm-Message-State: AOAM531W7u9qAjE6oz5GBIb8vnLXXpcqbpRxv+goIf2l8xtP4/y0CmPa yZU+JlB+XEYm/jjzTfKAcJrlfw== X-Received: by 2002:a17:90a:1944:: with SMTP id 4mr497852pjh.62.1632766049496; Mon, 27 Sep 2021 11:07:29 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z62sm115624pjj.53.2021.09.27.11.07.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 11:07:28 -0700 (PDT) Date: Mon, 27 Sep 2021 11:07:27 -0700 From: Kees Cook To: Mark Rutland Cc: Vito Caputo , Jann Horn , Thomas Gleixner , Josh Poimboeuf , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Jens Axboe , 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" , Qi Zheng , 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: <202109271103.4E15FC0@keescook> References: <20210923233105.4045080-1-keescook@chromium.org> <20210923234917.pqrxwoq7yqnvfpwu@shells.gnugeneration.com> <20210924002230.sijoedia65hf5bj7@shells.gnugeneration.com> <202109231814.FD09DBAD3@keescook> <20210924135424.GA33573@C02TD0UTHF1T.local> <202109240716.A0792BE46@keescook> <20210927090337.GB1131@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210927090337.GB1131@C02TD0UTHF1T.local> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 27, 2021 at 10:03:51AM +0100, Mark Rutland wrote: > On Fri, Sep 24, 2021 at 07:26:22AM -0700, Kees Cook wrote: > > On Fri, Sep 24, 2021 at 02:54:24PM +0100, Mark Rutland wrote: > > > On Thu, Sep 23, 2021 at 06:16:16PM -0700, Kees Cook wrote: > > > > On Thu, Sep 23, 2021 at 05:22:30PM -0700, Vito Caputo wrote: > > > > > Instead of unwinding stacks maybe the kernel should be sticking an > > > > > entrypoint address in the current task struct for get_wchan() to > > > > > access, whenever userspace enters the kernel? > > > > > > > > wchan is supposed to show where the kernel is at the instant the > > > > get_wchan() happens. (i.e. recording it at syscall entry would just > > > > always show syscall entry.) > > > > > > It's supposed to show where a blocked task is blocked; the "wait > > > channel". > > > > > > I'd wanted to remove get_wchan since it requires cross-task stack > > > walking, which is generally painful. > > > > Right -- this is the "fragile" part I'm worried about. I'd like to clarify this concern first -- is the proposed fix actually fragile? Because I think we'd be better off just restoring behavior than trying to invent new behavior... i.e. Josh, Jann, do you see any issues with Qi Zheng's fix here: https://lore.kernel.org/all/20210924062006.231699-4-keescook@chromium.org/ -Kees -- Kees Cook