Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 1 Nov 2016 11:02:41 +0000
From: "Reshetova, Elena" <elena.reshetova@...el.com>
To: Colin Vidal <colin@...dal.org>, "kernel-hardening@...ts.openwall.com"
	<kernel-hardening@...ts.openwall.com>, Hans Liljestrand <ishkamiel@...il.com>
CC: "keescook@...omium.org" <keescook@...omium.org>, "arnd@...db.de"
	<arnd@...db.de>, "tglx@...utronix.de" <tglx@...utronix.de>,
	"mingo@...hat.com" <mingo@...hat.com>, "Anvin, H Peter"
	<h.peter.anvin@...el.com>, David Windsor <dwindsor@...il.com>
Subject: RE: [RFC v3 PATCH 01/13] Add architecture
 independent hardened atomic base

>Elena,

> diff --git a/include/asm-generic/atomic-long.h 
> b/include/asm-generic/atomic-long.h
<snip>
> +#ifndef CONFIG_HARDENED_ATOMIC
> +#ifndef atomic_read_wrap
> +#define atomic_read_wrap(v) atomic_read(v) #endif /* atomic_read_wrap 
> +*/ #ifndef atomic_set_wrap #define atomic_set_wrap(v, i) 
> +atomic_set((v), (i)) #endif /* atomic_set_wrap */ #define 
> +atomic_add_wrap(i, v) atomic_add((i), (v)) #define atomic_sub_wrap(i, 
> +v) atomic_sub((i), (v)) #define atomic_inc_wrap(v) atomic_inc(v) 
> +#define atomic_dec_wrap(v) atomic_dec(v) #ifndef 
> +atomic_add_return_wrap #define atomic_add_return_wrap(i, v) 
> +atomic_add_return((i), (v)) #endif /* atomic_add_return_wrap */ 
> +#ifndef atomic_sub_return_wrap #define atomic_sub_return_wrap(i, v) 
> +atomic_sub_return((i), (v)) #endif /* atomic_sub_return_wrap */ 
> +#define atoimc_dec_return_wrap(v) atomic_dec_return(v) #ifndef 
> +atomic_inc_return_wrap #define atomic_inc_return_wrap(v) 
> +atomic_inc_return(v) #endif /* atomic_inc_return */ #ifndef 
> +atomic_dec_and_test_wrap #define atomic_dec_and_test_wrap(v) 
> +atomic_dec_and_test(v) #endif /* atomic_dec_and_test_wrap */ #ifndef 
> +atomic_inc_and_test_wrap #define atomic_inc_and_test_wrap(v) 
> +atomic_inc_and_test(v) #endif /* atomic_inc_and_test_wrap */ #define 
> +atomic_sub_and_test_wrap(i, v) atomic_sub_and_test((v), (i)) #ifndef 
> +atomic_xchg_wrap #define atomic_xchg_wrap(v, i) atomic_xchg((v), (i)) 
> +#endif /*  atomic_xchg_wrap(v, i) */ #ifndef atomic_cmpxchg_wrap 
> +#define atomic_cmpxchg_wrap(v, o, n) atomic_cmpxchg((v), (o), (n)) 
> +#endif /* atomic_cmpxchg_wrap */ #define atomic_add_negative_wrap(i, 
> +v) atomic_add_negative((i), (v)) #define atomic_add_unless_wrap(v, i, 
> +j) atomic_add_unless((v), (i), (j)) #endif /* CONFIG_HARDENED_ATOMIC 
> +*/
> +
>  #endif  /*  _ASM_GENERIC_ATOMIC_LONG_H  */
> 

>It seems there are two missing guard here. I've got redefinition errors on ARM (without my prototypes of arm generic atomic64 and arm hardened atomic patches).

Yes, I think every function here needs a guard, not sure why it was left this way... I will go ahead and make the change. 
Hans, please scream if this was intentional for some reason and breaks anything else (I doubt though..)
Thank you again! I will update the hardened_atomic_next with fixes, so you can base your patches out of it. 


>Thanks

>Colin

diff --git a/include/asm-generic/atomic-long.h b/include/asm- generic/atomic-long.h index 60eb9e0..131f637 100644
--- a/include/asm-generic/atomic-long.h
+++ b/include/asm-generic/atomic-long.h
@@ -400,14 +400,18 @@ static inline long atomic_long_add_unless_wrap(atomic_long_wrap_t *l, long a, lo
 #ifndef atomic_inc_and_test_wrap
 #define atomic_inc_and_test_wrap(v) atomic_inc_and_test(v)
 #endif /* atomic_inc_and_test_wrap */
+#ifndef atomic_sub_and_test_wrap
 #define atomic_sub_and_test_wrap(i, v) atomic_sub_and_test((v), (i))
+#endif /* atomic_sub_and_test_wrap */
 #ifndef atomic_xchg_wrap
 #define atomic_xchg_wrap(v, i) atomic_xchg((v), (i))
 #endif /*  atomic_xchg_wrap(v, i) */
 #ifndef atomic_cmpxchg_wrap
 #define atomic_cmpxchg_wrap(v, o, n) atomic_cmpxchg((v), (o), (n))
 #endif /* atomic_cmpxchg_wrap */
+#ifndef atomic_add_negative_wrap
 #define atomic_add_negative_wrap(i, v) atomic_add_negative((i), (v))
+#endif /* atomic_add_negative_wrap */
 #define atomic_add_unless_wrap(v, i, j) atomic_add_unless((v), (i),
(j))
 #endif /* CONFIG_HARDENED_ATOMIC */

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.