From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752256AbdLLRS4 (ORCPT ); Tue, 12 Dec 2017 12:18:56 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:43338 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751566AbdLLRSx (ORCPT ); Tue, 12 Dec 2017 12:18:53 -0500 X-Google-Smtp-Source: ACJfBotC06Gy+u5lDTB/TZINk5PK6udBQQ+9yKaph63ZPzK/St72PYQ3sETtsVYlX+Nd3+OErsYuEg== Date: Tue, 12 Dec 2017 20:18:50 +0300 From: "Kirill A. Shutemov" To: Andy Lutomirski Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , Brian Gerst , David Laight , Kees Cook , Peter Zijlstra , stable@vger.kernel.org, Dave Hansen Subject: Re: [PATCH PTI v3 01/10] x86/espfix/64: Fix espfix double-fault handling on 5-level systems Message-ID: <20171212171850.ji5fuluf7wbw4jh4@node.shutemov.name> References: <24c898b4f44fdf8c22d93703850fb384ef87cfdc.1513035461.git.luto@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <24c898b4f44fdf8c22d93703850fb384ef87cfdc.1513035461.git.luto@kernel.org> User-Agent: NeoMutt/20171027 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 12, 2017 at 07:56:36AM -0800, Andy Lutomirski wrote: > Using PGDIR_SHIFT to identify espfix64 addresses on 5-level systems > was wrong, and it resulted in panics due to unhandled double faults. > Use P4D_SHIFT instead, which is correct on 4-level and 5-level > machines. > > This fixes a panic when running x86 selftests on 5-level machines. > > Fixes: 1d33b219563f ("x86/espfix: Add support for 5-level paging") > Cc: stable@vger.kernel.org > Cc: "Kirill A. Shutemov" > Cc: Dave Hansen > Signed-off-by: Andy Lutomirski Thanks for catching this. Acked-by: Kirill A. Shutemov I remember that I tested espfix before and it was fine. That's strange. With this patch on top of tip/WIP.x86/pti plus the change I've mentioned before, sigreturn_64 doesn't crash qemu for me anymore. -- Kirill A. Shutemov