Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20161118114234.GB1197@leverpostej>
Date: Fri, 18 Nov 2016 11:42:35 +0000
From: Mark Rutland <mark.rutland@....com>
To: Kees Cook <keescook@...omium.org>
Cc: "kernel-hardening@...ts.openwall.com" <kernel-hardening@...ts.openwall.com>
Subject: Re: patches for __write_rarely section

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.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.