From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754720AbcILR5K (ORCPT ); Mon, 12 Sep 2016 13:57:10 -0400 Received: from thejh.net ([37.221.195.125]:39589 "EHLO thejh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751998AbcILR5F (ORCPT ); Mon, 12 Sep 2016 13:57:05 -0400 Date: Mon, 12 Sep 2016 19:56:56 +0200 From: Jann Horn To: Andy Lutomirski Cc: Kyle Huey , Thomas Gleixner , John Stultz , Ingo Molnar , Michal Hocko , Andrew Morton , "Michael S. Tsirkin" , Alexander Shishkin , Aravind Gopalakrishnan , Vlastimil Babka , "Luis R. Rodriguez" , Mateusz Guzik , Alex Thorlton , "Rafael J. Wysocki" , Dmitry Vyukov , Vladimir Zapolskiy , Jiri Slaby , Andrey Ryabinin , Ben Segall , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Denys Vlasenko , Paul Gortmaker , Srinivas Pandruvada , "Robert O'Callahan" , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Juergen Gross , Linux API , Fenghua Yu , Kees Cook , "Peter Zijlstra (Intel)" , Borislav Petkov , Len Brown , Huang Rui , "H. Peter Anvin" Subject: Re: [PATCH] prctl,x86 Add PR_[GET|SET]_CPUID for controlling the CPUID instruction. Message-ID: <20160912175656.GA8935@laptop.thejh.net> References: <1473640169-24145-1-git-send-email-khuey@kylehuey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 On Mon, Sep 12, 2016 at 09:56:11AM -0700, Andy Lutomirski wrote: > On Sep 11, 2016 5:29 PM, "Kyle Huey" wrote: > > > > rr (http://rr-project.org/), a userspace record-and-replay reverse- > > execution debugger, would like to trap and emulate the CPUID instruction. > > This would allow us to a) mask away certain hardware features that rr does > > not support (e.g. RDRAND) and b) enable trace portability across machines > > by providing constant results. > > > > Intel supports faulting on the CPUID instruction in newer processors. Bit > > 31 of MSR_PLATFORM_INFO advertises support for this feature. It is > > documented in detail in Section 2.3.2 of > > http://www.intel.com/content/dam/www/public/us/en/documents/application-notes/virtualization-technology-flexmigration-application-note.pdf. [...] > If this bit is preserved on fork(), then no_new_privs must be checked > (or it must be cleared on "unsafe" exec, but that's nasty). I think you mean "preserved on execve()"? From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jann Horn Subject: Re: [PATCH] prctl,x86 Add PR_[GET|SET]_CPUID for controlling the CPUID instruction. Date: Mon, 12 Sep 2016 19:56:56 +0200 Message-ID: <20160912175656.GA8935@laptop.thejh.net> References: <1473640169-24145-1-git-send-email-khuey@kylehuey.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Andy Lutomirski Cc: Kyle Huey , Thomas Gleixner , John Stultz , Ingo Molnar , Michal Hocko , Andrew Morton , "Michael S. Tsirkin" , Alexander Shishkin , Aravind Gopalakrishnan , Vlastimil Babka , "Luis R. Rodriguez" , Mateusz Guzik , Alex Thorlton , "Rafael J. Wysocki" , Dmitry Vyukov , Vladimir Zapolskiy , Jiri Slaby , Andrey Ryabinin , Ben Segall , mainta List-Id: linux-api@vger.kernel.org On Mon, Sep 12, 2016 at 09:56:11AM -0700, Andy Lutomirski wrote: > On Sep 11, 2016 5:29 PM, "Kyle Huey" wrote: > > > > rr (http://rr-project.org/), a userspace record-and-replay reverse- > > execution debugger, would like to trap and emulate the CPUID instruction. > > This would allow us to a) mask away certain hardware features that rr does > > not support (e.g. RDRAND) and b) enable trace portability across machines > > by providing constant results. > > > > Intel supports faulting on the CPUID instruction in newer processors. Bit > > 31 of MSR_PLATFORM_INFO advertises support for this feature. It is > > documented in detail in Section 2.3.2 of > > http://www.intel.com/content/dam/www/public/us/en/documents/application-notes/virtualization-technology-flexmigration-application-note.pdf. [...] > If this bit is preserved on fork(), then no_new_privs must be checked > (or it must be cleared on "unsafe" exec, but that's nasty). I think you mean "preserved on execve()"?