public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Kees Cook <keescook@chromium.org>
Cc: Stephen Smalley <sds@tycho.nsa.gov>,
	"x86@kernel.org" <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH] x86/mm: warn on W+x mappings
Date: Thu, 1 Oct 2015 21:41:21 +0200	[thread overview]
Message-ID: <20151001194121.GC3764@pd.tnic> (raw)
In-Reply-To: <CAGXu5j+U_WAMMFgx8zSYBx5q+xOzG=RxFK9E8+e9ddvOUGciMQ@mail.gmail.com>

On Thu, Oct 01, 2015 at 12:24:25PM -0700, Kees Cook wrote:
> On Thu, Oct 1, 2015 at 9:28 AM, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> > Warn on any residual W+x mappings if X86_PTDUMP is enabled.
> >
> > Sample dmesg output:
> > Checking for W+x mappings
> > 0xffffffff81755000-0xffffffff81800000         684K     RW                 GLB x  pte
> > Found W+x mappings.  Please fix.
> >
> > Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
> > ---
> > Not sure if this is the best place to put this check.
> > It must occur after free_init_pages() or it won't catch the
> > W+x case for the gap between __ex_table and rodata.
> 
> Yeah. Hmm. I want this test for sure, but I'd like to be able to do
> with without needing PTDUMP, since that puts a very sensitive file in
> debugfs. I wonder if we can reuse the same code, but only expose the
> page tables to userspace with PTDUMP?

So make it a debugging option like CONFIG_EFI_PGT_DUMP and let it dump
the pagetable in dmesg during boot, at the exact point you want it to.
Then one can grep dmesg for W+x bits or whatever else...

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

  reply	other threads:[~2015-10-01 19:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-01 16:28 [RFC][PATCH] x86/mm: warn on W+x mappings Stephen Smalley
2015-10-01 19:24 ` Kees Cook
2015-10-01 19:41   ` Borislav Petkov [this message]
2015-10-02  7:26     ` Ingo Molnar
2015-10-02  8:02       ` Borislav Petkov
2015-10-03  7:50         ` Ingo Molnar
2015-10-03  9:01           ` Borislav Petkov
2015-10-02  7:37 ` Ingo Molnar

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=20151001194121.GC3764@pd.tnic \
    --to=bp@alien8.de \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    --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