Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp210156imm; Fri, 5 Oct 2018 02:28:09 -0700 (PDT) X-Google-Smtp-Source: ACcGV63ZwdWEOzrpYVjpkY7f/o6fF/mtLc59R4bhZ11Oij3Ou3KD4MBRdQ2KOV5+eT8y6ICndEpb X-Received: by 2002:a62:579c:: with SMTP id i28-v6mr10885411pfj.158.1538731689772; Fri, 05 Oct 2018 02:28:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538731689; cv=none; d=google.com; s=arc-20160816; b=IQ3PIYeY0WJNeTzKJjAX9iSi9siT1fKCCdIR5I5PEfbmgvsp36Zh8ydbAr9RAr3DfL 66ISJezf4xyOIxX6DnPO4iXQgIwxpiMzZ5ZhgrJuqkA8H0J/D0HHcZeRtKePdJDHHgzB GFbb9rO+O1mbRCQ0OjhJ4+Wb1PRyzfHf00iI9JUeRzccV3Fbq0JJr+lV34Y1JaTvX72L UWV56Ca3fdTfZlkYVd4rrYpxOJH5lAtdgAkggiGi7CX/JwTzetZFvl48GH9kbemoztU3 7mu3H6Tfd8/Q7z6m7+zq256AIMzE9rbVukVFivxP62Fo+DzVWjHZ8osC5WhRqKmN4+iJ AE5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=T/2nkE/+tX/K9biCdeezUwo40pDYSG1zWwdFSHFu9SY=; b=eVESiBNn28q5j6drabfw7RAngdidAs07Q4elX0ACgBFi3bNVdW6AP0ZeGSbHUvWrJ6 +D62XlkWI7ooUn9BLNqx/+SJXtyp/hxxOezlXIPTADZQkPbYaNMCvBXE+n72XmDBAUd9 wToGQ3qiCkunDBCI8VgweEGmlx34+nZ60BUfxvqbyZiz0AHD7tYjupJw+PEKxzMXnzha oxo8VRutUIphHG7f4ljoBQNMAuQ+W66nGqEsO8a/1esSC3IOmdX9Up5d1fPWMRlhUytR ulDRShSvJRvxA95yhJye9LRABF4dazTxmONkjklVX7qtUOKWRFLCH6KB0hz/qH0NzJum fIrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4-v6si8264858pll.431.2018.10.05.02.27.53; Fri, 05 Oct 2018 02:28:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728021AbeJEQZ2 (ORCPT + 99 others); Fri, 5 Oct 2018 12:25:28 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:37685 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727107AbeJEQZ2 (ORCPT ); Fri, 5 Oct 2018 12:25:28 -0400 Received: from tmo-098-72.customers.d1-online.com ([80.187.98.72] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1g8MON-0006Vl-24; Fri, 05 Oct 2018 11:27:27 +0200 Date: Fri, 5 Oct 2018 11:27:21 +0200 (CEST) From: Thomas Gleixner To: Joerg Roedel cc: Borislav Petkov , Paul Menzel , linux-mm@kvack.org, x86@kernel.org, lkml Subject: Re: x86/mm: Found insecure W+X mapping at address (ptrval)/0xc00a0000 In-Reply-To: <20181004080321.GA3630@8bytes.org> Message-ID: References: <0922cc1b-ed51-06e9-df81-57fd5aa8e7de@molgen.mpg.de> <20181003212255.GB28361@zn.tnic> <20181004080321.GA3630@8bytes.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 4 Oct 2018, Joerg Roedel wrote: > On Wed, Oct 03, 2018 at 11:22:55PM +0200, Borislav Petkov wrote: > > On Fri, Sep 28, 2018 at 04:55:19PM +0200, Thomas Gleixner wrote: > > > Sorry for the delay and thanks for the data. A quick diff did not reveal > > > anything obvious. I'll have a closer look and we probably need more (other) > > > information to nail that down. > > I also triggered this when working in the PTI-x32 code. It always > happens on a 32-bit PAE kernel for me. > > Tracking it down I ended up in (iirc) arch/x86/mm/pageattr.c > function static_protections(): > > /* > * The BIOS area between 640k and 1Mb needs to be executable for > * PCI BIOS based config access (CONFIG_PCI_GOBIOS) support. > */ > #ifdef CONFIG_PCI_BIOS > if (pcibios_enabled && within(pfn, BIOS_BEGIN >> PAGE_SHIFT, BIOS_END >> PAGE_SHIFT)) > pgprot_val(forbidden) |= _PAGE_NX; > #endif > > I think that is the reason we are seeing this in that configuration. Uurgh. Yes. If pcibios is enabled and used, need to look at the gory details of that first, then the W+X check has to exclude that region. We can't do much about that. Thanks, tglx