From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4BEFC433EF for ; Wed, 29 Sep 2021 19:01:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B80A1611C0 for ; Wed, 29 Sep 2021 19:01:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346405AbhI2TDT (ORCPT ); Wed, 29 Sep 2021 15:03:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:41968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345276AbhI2TDN (ORCPT ); Wed, 29 Sep 2021 15:03:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C94A961452; Wed, 29 Sep 2021 19:01:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632942092; bh=9BZ9SSNsunYXKIbF+mdQMEB+a7jO8KRnYCiZ9joa8Kw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ByqA7vIURnm2UsOZu2n0iL0xlzT0yi80z6jgMGuxYEqGCH0zXDvI6R1U0qBAfdIKf mvm55L8qEXRhYLRnAo/xnvZk88WT3ihqdM7wzWzxzmAUvVmF7XPWpdZdrVMCm7kz0v JNF1LiRbKiZztxduPw91K44Mg1QcybzLj87Dtw0T1a3L8LpUcdvtwi61dEaEpWLh0R mNFmWK+uPoDh4AV4G+3h3EbzPHPxPazjmxBT7uAUBxdxaIZ/QqnUsEJzN/P1kKwArp czJvKoCKbo0uSN92OmrSI74V/u89rF0mcDU0FXPXKWmCFvWNX3OYBp7Fmq6nwiANeJ TWlsJvmH339pA== Date: Wed, 29 Sep 2021 20:00:42 +0100 From: Mark Brown To: Kees Cook Cc: Josh Poimboeuf , Mark Rutland , Vito Caputo , Jann Horn , Thomas Gleixner , 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: <20210929190042.GU4199@sirena.org.uk> References: <20210923234917.pqrxwoq7yqnvfpwu@shells.gnugeneration.com> <20210924002230.sijoedia65hf5bj7@shells.gnugeneration.com> <202109231814.FD09DBAD3@keescook> <20210924135424.GA33573@C02TD0UTHF1T.local> <202109240716.A0792BE46@keescook> <20210927090337.GB1131@C02TD0UTHF1T.local> <202109271103.4E15FC0@keescook> <20210927205056.jjdlkof5w6fs5wzw@treble> <202109291152.681444A135@keescook> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pzbqGaOtRNiVr7w4" Content-Disposition: inline In-Reply-To: <202109291152.681444A135@keescook> X-Cookie: 98% lean. User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org --pzbqGaOtRNiVr7w4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Sep 29, 2021 at 11:54:55AM -0700, Kees Cook wrote: > On Mon, Sep 27, 2021 at 01:50:56PM -0700, Josh Poimboeuf wrote: > > Even with that patch, it doesn't lock the task's runqueue before reading > > the stack, so there's still the possibility of the task running on > > another CPU and the unwinder going off the rails a bit, which might be > > used by an attacker in creative ways similar to the /proc//stack > > vulnerability Jann mentioned earlier. > Since I think we're considering get_wchan() to be slow-path, can we just > lock the runqueue and use arch_stack_walk_reliable()? Unfortunately arch_stack_walk_reliable() is only available for powerpc, s390 and x86 currently - work is in progress to implement it for arm64 as well but it's not there yet. --pzbqGaOtRNiVr7w4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmFUt9kACgkQJNaLcl1U h9BfJgf+O3xANtFrCZ5ZmvugZNPSBKmFmwXYza30TbY2cow+hwARTUCHPxRCDxq3 xHnib4kJ43GPqzw/CGZzdzYMv9JY6Uxk7o0v/4bemkoH5hywwVC0vefRVeFCsX9b Wq7NwpmwbKz9hL3fRnlWL5Y8MGWieuOo+QgK5eOe82h9Z9BjzxLTY2hIKk09AlQA NGouW/lSLQPyfN5SyD2LKETG1y2SlY3GwYEZIDSCScY/9JnlF40pgByIudz+Xi5O xIZUR6UpeCQAAFf6f6VgoUWVAdVgLKMq/wnBmajicvzj+p8QFi3krttH2H8ZwVX6 v2RVJaXwOmj/g/llVWW6WgZqgxcz2Q== =nUIA -----END PGP SIGNATURE----- --pzbqGaOtRNiVr7w4--