public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
	Ingo Molnar <mingo@kernel.org>, Peter Anvin <hpa@zytor.com>,
	Fengguang Wu <fengguang.wu@intel.com>,
	Network Development <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>, LKP <lkp@01.org>,
	ast@fb.com, the arch/x86 maintainers <x86@kernel.org>
Subject: Re: [net/bpf] 3051bf36c2 BUG: unable to handle kernel paging request at 0000a7cf
Date: Thu, 9 Mar 2017 14:09:00 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1703091248410.3521@nanos> (raw)
In-Reply-To: <CA+55aFy97mLPLb4WXmRn-xLMNt+bNkrb_vaBsh+HOMLLnKPv7Q@mail.gmail.com>

On Wed, 8 Mar 2017, Linus Torvalds wrote:

> Adding x86 people too, since this seems to be something off about
> ARCH_HAS_SET_MEMORY for x86-32.
> 
> The code seems to be shared between x86-32 and 64, I'm not seeing why
> set_memory_r[ow]() should fail on one but not the other.

Indeed.

> Considering that it seems to be flaky even on 32-bit, maybe it's
> timing-related, or possibly related to TLB sizes or whatever (ie more
> likely hidden by a larger TLB on more modern hardware?)

The only difference I can see is the way how __tlb_flush_all() is
happening. We have 3 variants:

   invpcid_flush_all()  - depends on X86_FEATURE_INVPCID and X86_FEATURE_PGE
   cr4 based flush	- depends on X86_FEATURE_PGE
   cr3 based flush

No idea which variant is used in that failure case.

> Anyway, just looking at change_page_attr_set_clr(), I notice that the
> page alias checking treats NX specially:
> 
>         /* No alias checking for _NX bit modifications */
>         checkalias = (pgprot_val(mask_set) | pgprot_val(mask_clr)) != _PAGE_NX;
> 
> which seems insane. Why would NX be different from other protection
> bits (like _PAGE_RW)?

The reason is that the alias mapping should never be executable at all.

Thanks,

	tglx

      parent reply	other threads:[~2017-03-09 13:09 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01 12:54 [net/bpf] 3051bf36c2 BUG: unable to handle kernel paging request at 0000a7cf Fengguang Wu
2017-03-02 20:23 ` Fengguang Wu
2017-03-02 20:40   ` Daniel Borkmann
2017-03-08 19:25     ` Linus Torvalds
2017-03-08 22:27       ` Daniel Borkmann
2017-03-08 22:36         ` Kees Cook
2017-03-08 22:51           ` Daniel Borkmann
2017-03-08 23:55           ` Laura Abbott
2017-03-09  5:36             ` Kees Cook
2017-03-09 13:04               ` Daniel Borkmann
2017-03-09 13:10                 ` Thomas Gleixner
2017-03-09 13:25                   ` Daniel Borkmann
2017-03-09 14:49                     ` Thomas Gleixner
2017-03-09 17:51                       ` Daniel Borkmann
2017-03-09 18:08                         ` David Miller
2017-03-09 18:10                         ` Linus Torvalds
2017-03-09 18:15                           ` Linus Torvalds
2017-03-09 18:31                             ` Daniel Borkmann
2017-03-09 21:32                               ` Daniel Borkmann
2017-03-09 21:55                                 ` Borislav Petkov
2017-03-09 22:07                                   ` Borislav Petkov
2017-03-09 22:11                                     ` Daniel Borkmann
2017-03-09 22:48                                       ` Borislav Petkov
2017-03-09 23:26                                         ` Linus Torvalds
2017-03-09 23:44                                           ` Borislav Petkov
2017-03-10  0:13                                             ` Daniel Borkmann
2017-03-12 21:40                                           ` Borislav Petkov
2017-03-09 14:53                     ` Daniel Borkmann
2017-03-09 17:48                       ` Linus Torvalds
2017-03-08 22:43         ` Linus Torvalds
2017-03-09  1:34           ` Fengguang Wu
2017-03-09 13:09       ` Thomas Gleixner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1703091248410.3521@nanos \
    --to=tglx@linutronix.de \
    --cc=ast@fb.com \
    --cc=daniel@iogearbox.net \
    --cc=fengguang.wu@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@01.org \
    --cc=mingo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox