All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Kees Cook <keescook@chromium.org>
Cc: "kernel-hardening@lists.openwall.com"
	<kernel-hardening@lists.openwall.com>
Subject: Re: [kernel-hardening] patches for __write_rarely section
Date: Fri, 18 Nov 2016 11:42:35 +0000	[thread overview]
Message-ID: <20161118114234.GB1197@leverpostej> (raw)
In-Reply-To: <20161118111059.GA1197@leverpostej>

On Fri, Nov 18, 2016 at 11:10:59AM +0000, Mark Rutland wrote:
> With something like the below (assuming all helpers are inlined):
> 
> #define rare_write(__var, __val) ({				\
> 	typeof(var) *__rw_var;					\

... iwith s/var/__var/ here...

> 	__some_typecheck_perhaps(__var, __val);			\
> 								\
> 	__rw_var = __rare_rw_ptr(&(__var));			\
> 								\
> 	__rare_rw_map();					\
> 	*__rw_var = (__val);					\
> 	__rare_rw_unmap();					\
> 								\
> 	__clobber_var_so_gcc_knows(__var);			\
> })

... and with explicit clobber gone, since __rare_rw_unmap would
presumably have to have a memory clobber anyway, just like the fixmap
code.

Thanks,
Mark.

  reply	other threads:[~2016-11-18 11:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-16 14:39 [kernel-hardening] patches for __write_rarely section Gengjia Chen
2016-11-16 15:16 ` Mark Rutland
2016-11-17 23:47   ` Kees Cook
2016-11-18 11:10     ` Mark Rutland
2016-11-18 11:42       ` Mark Rutland [this message]
2016-11-16 15:22 ` Rik van Riel
2016-11-16 16:14 ` Greg KH

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=20161118114234.GB1197@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    /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.