From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764069AbcIQCBD (ORCPT ); Fri, 16 Sep 2016 22:01:03 -0400 Received: from thejh.net ([37.221.195.125]:45219 "EHLO thejh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750774AbcIQCAz (ORCPT ); Fri, 16 Sep 2016 22:00:55 -0400 Date: Sat, 17 Sep 2016 04:00:51 +0200 From: Jann Horn To: Andy Lutomirski Cc: x86@kernel.org, Borislav Petkov , linux-kernel@vger.kernel.org, Brian Gerst Subject: Re: [PATCH 09/12] x86/process: Pin the target stack in get_wchan() Message-ID: <20160917020051.GD2543@pc.thejh.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AkbCVLjbJ9qUtAXD" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --AkbCVLjbJ9qUtAXD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Sep 13, 2016 at 02:29:29PM -0700, Andy Lutomirski wrote: > This will prevent a crash if get_wchan() runs after the task stack > is freed. I think I found some more stuff. Have a look at KSTK_EIP() and KSTK_ESP(), I think they read from the saved userspace registers area at the top of the kernel stack? Used on remote processes in: vma_is_stack_for_task() (via /proc/$pid/maps) do_task_stat() (/proc/$pid/stat) --AkbCVLjbJ9qUtAXD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJX3KPTAAoJED4KNFJOeCOo6XkQAJH0z/QHgUgQs7c54/ovmMcs nTryxSQgs14/AvksoOVQkbzQISqaGIadvQAyOTG+EyegmR/e58K4SIfAqBXfpsqb d1ezkGgfCRj4DTt68aDhY5yP0MLGhgzI9GFeuv8Ubd7iQHFXLkOTaN368VBVPaAk db74+KvDnTcxe5EC5+yVRL1SmxEzzrqRij18RSnI6L5hepLnc8in3IbT0Cyy3EFY tWN1s1aFzLg1Ak/lBm5FFMVL3mAZoG/zxs6f6mItkF0UhJBqs06vMz/PEvyxEHBl IKWBrNvZGFBNs4cqi6k2RcR6zg9q6DCp6A6dnqArVWJ2SrIMIVqRd7GzEGixBNqG ZKJQ64ryo7K7Qgai3hQ4XK32/+Pj0Y2wTy7KqSr781O/Dlr2g99TiDQnREIE+10Q 5RzbGUYEUnX+BU0ZvuR4PkmOg8Y4jrdeV7hEC7gAjpHk3RtP2aIAoyQx9dgDNwfZ wOcuk83IEdgTE7vkfrqEdg5dZwOOMVH79exXa0+BKsul6SBSQ6jYCwOFNxSPG1fF UIVA6JfuzKZ6jQipydh8c5CkXfAvA+UHfm9lC9dKtFBaiA8Nn24Mfen+oOLsuWSJ l7I8xNlv3cuxy26e6QY9hdwtrqExRLiSHZDhI+7eOg3kwNDzDM6D8EjCSKk/12JH acI3cBY2JdqnOk6wU0se =iNUd -----END PGP SIGNATURE----- --AkbCVLjbJ9qUtAXD--