From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753651AbdLMRCN (ORCPT ); Wed, 13 Dec 2017 12:02:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:58976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753301AbdLMRCM (ORCPT ); Wed, 13 Dec 2017 12:02:12 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 842FB218D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org X-Google-Smtp-Source: ACJfBou+b/AoqM6adH/7EyOljismZF24FlxJ5b9hKa+VWEK8Zak7nlUAgNuOYmqPMEPNQgPNtgybrnVyy5RoXq7rfSY= MIME-Version: 1.0 In-Reply-To: <20171213131205.adxjdggby7qpv22q@node.shutemov.name> References: <5eafbf867b587032f322898953d550d5bcaf751b.1513035461.git.luto@kernel.org> <20171213131205.adxjdggby7qpv22q@node.shutemov.name> From: Andy Lutomirski Date: Wed, 13 Dec 2017 09:01:50 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH PTI v3 03/10] x86/pti/64: Fix ESPFIX64 user mapping To: "Kirill A. Shutemov" Cc: Andy Lutomirski , X86 ML , "linux-kernel@vger.kernel.org" , Borislav Petkov , Brian Gerst , David Laight , Kees Cook , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 13, 2017 at 5:12 AM, Kirill A. Shutemov wrote: > On Tue, Dec 12, 2017 at 07:56:38AM -0800, Andy Lutomirski wrote: >> The ESPFIX64 user mapping belongs in pti.c just like all the other >> user mappings. Move it there and make it work correctly while we're >> at it. >> >> Signed-off-by: Andy Lutomirski > > Acked-by: Kirill A. Shutemov > > BTW, why do we open-code p?d_alloc() in pti_user_pagetable_walk_*()? > It seems unnecessary and potentially bogus: see smp_wmb() in __p?d_alloc() > helpers. The helpers won't work -- we're allocating kernel-owned tables in the usermode part of init_mm. The p?d_alloc() helpers allocate user-accounted tables in the kernelmode part of the mm. --Andy