All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Micay <danielmicay@gmail.com>
To: Tejun Heo <tj@kernel.org>
Cc: Christoph Lameter <cl@linux.com>,
	Kees Cook <keescook@chromium.org>,
	kernel-hardening@lists.openwall.com
Subject: [kernel-hardening] Re: [PATCH] mark most percpu globals as __ro_after_init
Date: Wed, 10 May 2017 13:59:32 -0400	[thread overview]
Message-ID: <1494439172.1255.1.camel@gmail.com> (raw)
In-Reply-To: <20170510175238.GH32165@htj.duckdns.org>

On Wed, 2017-05-10 at 13:52 -0400, Tejun Heo wrote:
> Hello, Daniel.
> 
> On Wed, May 10, 2017 at 01:36:37PM -0400, Daniel Micay wrote:
> > Moving pcpu_base_addr to this section comes from PaX where it's part
> > of
> > KERNEXEC. This extends it to the rest of the globals only written by
> > the
> > init code.
> 
> How did you test the patch?

Booted / did some stuff on x86 (it's running right now), and currently
building it for a 3.18 arm64 kernel to test there.

> 
> > -static struct list_head *pcpu_slot __read_mostly; /* chunk list
> > slots */
> > +static struct list_head *pcpu_slot __ro_after_init; /* chunk list
> > slots */
> 
> At least this one isn't read only.

It's the array it points to being modified after it gets assigned to
during init with pcpu_slot = memblock_virt_alloc(...), not the pointer
variable itself. The references after init are all pcpu_slot[...]
including taking references to slots in the array so there's always a
dereference happening first.

  reply	other threads:[~2017-05-10 17:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-10 17:36 [kernel-hardening] [PATCH] mark most percpu globals as __ro_after_init Daniel Micay
2017-05-10 17:52 ` [kernel-hardening] " Tejun Heo
2017-05-10 17:59   ` Daniel Micay [this message]
2017-05-10 18:31     ` Daniel Micay
2017-05-10 19:20     ` Tejun Heo
2017-05-10 18:16 ` Kees Cook
2017-05-10 18:16   ` 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=1494439172.1255.1.camel@gmail.com \
    --to=danielmicay@gmail.com \
    --cc=cl@linux.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=tj@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.