Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1544366pxb; Fri, 24 Sep 2021 06:56:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiOmJF0kT35J1rNqoaQkvVmGsmR2ZKnayGKzZIqkkPZn8tYBLm5EgWCkO0cXVeNrJsWVUR X-Received: by 2002:a6b:ec03:: with SMTP id c3mr9225610ioh.179.1632491781389; Fri, 24 Sep 2021 06:56:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632491781; cv=none; d=google.com; s=arc-20160816; b=WftpgcGbsYBvdEnFpvz8yifQ8KgW1SOtrSfyg3ps4KFnbHU7Ha3av4yH8dgDRFWQJy VUzR9C5/z2FGuNX0Ue/etIUqI46As3+3bqwDdlnDKIQLQpmrrrAUxWBwVSAbwRFx4CUH OnuM80TUlHLx289W0GjxbQD7582VWl8FmB2kVHqzgXpy/x8aMJ5xkm8A6bViCILQv1jb K5LKQU8Cx1u9WRK3HEKhc1zkN3/u6jk/ZCStfDZzhVHijclw7zcI2eJUEalPFsehWiHK WQXymYcsTvH+umLmd0WLc6DiUSKSHMuSXqyKtc6JG4o377lP+Jnao6h6n615v9NR8Zi7 PIYQ== 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; bh=CKfnHT4uxgxp8BAe+hxDEIbE0+mpbmW7dLw/rSG7ruA=; b=LnKuQifxaeUYlClx8SLXKoRrFRL5m3q589IKVroYuuWAFveddIONq4+CrnvuzoEpZD 3uttSuYCCDK6kxVMRywbj9TGZd+yPeGPQxaDb0oJyTVnrXb3IYCZD9K5xblj++ly9HyR FIZX/RBMpyWCbrrVGWWNsta7ty9nlWbkm7Rl4jOiQqgodjSzRr6i9lRqfn/yXwlnQWYV xH1dcMbeFipMSL65KJUasYnZAxCkZQzK1MiQGnoCyE6k79WTaAs3FQKCwU0tI6qo44Zv zcLGwyDygea9jIMRM6VpWBOAmPqdvskYLkONQ1AvTk1TwHM89hyd8uj5OI3IG4AF1WQN Z8bw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n32si4440496ioz.14.2021.09.24.06.56.03; Fri, 24 Sep 2021 06:56:21 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234615AbhIXN4L (ORCPT + 99 others); Fri, 24 Sep 2021 09:56:11 -0400 Received: from foss.arm.com ([217.140.110.172]:50004 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231174AbhIXN4K (ORCPT ); Fri, 24 Sep 2021 09:56:10 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4F197D6E; Fri, 24 Sep 2021 06:54:37 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.20.247]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CF8D43F719; Fri, 24 Sep 2021 06:54:30 -0700 (PDT) Date: Fri, 24 Sep 2021 14:54:24 +0100 From: Mark Rutland To: Kees Cook 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 =?utf-8?B?V2Vpw58=?= , 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: <20210924135424.GA33573@C02TD0UTHF1T.local> References: <20210923233105.4045080-1-keescook@chromium.org> <20210923234917.pqrxwoq7yqnvfpwu@shells.gnugeneration.com> <20210924002230.sijoedia65hf5bj7@shells.gnugeneration.com> <202109231814.FD09DBAD3@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202109231814.FD09DBAD3@keescook> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. We could instead have the scheduler entrypoints snapshot their caller into a field in task_struct. If there are sufficiently few callers, that could be an inline wrapper that passes a __func__ string. Otherwise, we still need to symbolize. Thanks, Mark.