linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "keescook@chromium.org" <keescook@chromium.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	"arjan@linux.intel.com" <arjan@linux.intel.com>,
	"jannh@google.com" <jannh@google.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"kristen@linux.intel.com" <kristen@linux.intel.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"alexei.starovoitov@gmail.com" <alexei.starovoitov@gmail.com>,
	"kernel-hardening@lists.openwall.com" 
	<kernel-hardening@lists.openwall.com>,
	"Hansen, Dave" <dave.hansen@intel.com>
Subject: Re: [PATCH v6 2/4] x86/modules: Increase randomization for modules
Date: Mon, 24 Sep 2018 21:27:59 +0000	[thread overview]
Message-ID: <1537824509.19013.63.camel@intel.com> (raw)
In-Reply-To: <CAGXu5jKho6Ui0sP6-4FN=i6zZ1+gXcd9Zyctqhvg+4r1cz-Mqw@mail.gmail.com>

On Mon, 2018-09-24 at 12:58 -0700, Kees Cook wrote:
> On Mon, Sep 24, 2018 at 11:57 AM, Edgecombe, Rick P
> <rick.p.edgecombe@intel.com> wrote:
> > > Instead of having two open-coded __vmalloc_node_range() calls left in
> > > this after the change, can this be done in terms of a call to
> > > try_module_alloc() instead? I see they're slightly different, but it
> > > might be nice for making the two paths share more code.
> > Not sure what you mean. Across the whole change, there is one call
> > to __vmalloc_node_range, and one to __vmalloc_node_try_addr.
> I guess I meant the vmalloc calls -- one for node_range and one for
> node_try_addr. I was wondering if the logic could be combined in some
> way so that the __vmalloc_node_range() could be made in terms of the
> the helper that try_module_randomize_each() uses. But this could just
> be me hoping for nice-to-read changes. ;)
> 
> -Kees
One thing I had been considering was to move the whole "try random locations,
then use backup" logic to vmalloc.c, and just have parameters for random area
size, number of tries, etc. This way it could be possibly be re-used for other
architectures for modules. Also on our list is to look at randomizing vmalloc
space (especially stacks), which may or may not involve using a similar method.

So maybe bit pre-mature refactoring, but would also clean up the code in
module.c. Do you think it would be worth it?

Thanks,

Rick

  reply	other threads:[~2018-09-24 21:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1536874298-23492-1-git-send-email-rick.p.edgecombe@intel.com>
2018-09-13 21:31 ` [PATCH v6 1/4] vmalloc: Add __vmalloc_node_try_addr function Rick Edgecombe
2018-09-21 18:46   ` Kees Cook
2018-09-13 21:31 ` [PATCH v6 2/4] x86/modules: Increase randomization for modules Rick Edgecombe
2018-09-21 19:05   ` Kees Cook
2018-09-24 18:57     ` Edgecombe, Rick P
2018-09-24 19:58       ` Kees Cook
2018-09-24 21:27         ` Edgecombe, Rick P [this message]
2018-09-24 21:29           ` Kees Cook
2018-09-13 21:31 ` [PATCH v6 3/4] vmalloc: Add debugfs modfraginfo Rick Edgecombe
2018-09-21 18:56   ` Kees Cook
2018-09-24 18:58     ` Edgecombe, Rick P
2018-09-24 20:03       ` Kees Cook
2018-09-13 21:31 ` [PATCH v6 4/4] Kselftest for module text allocation benchmarking Rick Edgecombe
2018-09-21 19:05 ` [PATCH v6 0/4] KASLR feature to randomize each loadable module Kees Cook

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=1537824509.19013.63.camel@intel.com \
    --to=rick.p.edgecombe@intel.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=arjan@linux.intel.com \
    --cc=daniel@iogearbox.net \
    --cc=dave.hansen@intel.com \
    --cc=hpa@zytor.com \
    --cc=jannh@google.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=kristen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --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;
as well as URLs for NNTP newsgroup(s).