From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752506AbdLNOKm (ORCPT ); Thu, 14 Dec 2017 09:10:42 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:45289 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbdLNOKl (ORCPT ); Thu, 14 Dec 2017 09:10:41 -0500 X-Google-Smtp-Source: ACJfBotDvqdvhcHvSs4iTRfgsw6PI2MzOmYh+F+f+6IhooHNilgWkZ69mVoPtDCMzp7OdSUfhitmAw== Date: Thu, 14 Dec 2017 17:10:38 +0300 From: "Kirill A. Shutemov" To: Andy Lutomirski Cc: X86 ML , "linux-kernel@vger.kernel.org" , Borislav Petkov , Brian Gerst , David Laight , Kees Cook , Peter Zijlstra Subject: Re: [PATCH PTI v3 03/10] x86/pti/64: Fix ESPFIX64 user mapping Message-ID: <20171214141038.7bddwvkabuy6ikxm@node.shutemov.name> References: <5eafbf867b587032f322898953d550d5bcaf751b.1513035461.git.luto@kernel.org> <20171213131205.adxjdggby7qpv22q@node.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171208 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 13, 2017 at 09:01:50AM -0800, Andy Lutomirski wrote: > 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. What's wrong to account them against init_mm? -- Kirill A. Shutemov