diff options
author | Rich Felker <dalias@aerifal.cx> | 2014-08-17 00:46:26 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2014-08-17 00:46:26 -0400 |
commit | de7e99c58508ca70f0b1b8ef259a823a3766c434 (patch) | |
tree | 68fbc616cb85a0a5a2992f64080d19b25855088f /arch | |
parent | d338b506e39b1e2c68366b12be90704c635602ce (diff) | |
download | musl-de7e99c58508ca70f0b1b8ef259a823a3766c434.tar.gz |
make pointers used in robust list volatile
when manipulating the robust list, the order of stores matters,
because the code may be asynchronously interrupted by a fatal signal
and the kernel will then access the robust list in what is essentially
an async-signal context.
previously, aliasing considerations made it seem unlikely that a
compiler could reorder the stores, but proving that they could not be
reordered incorrectly would have been extremely difficult. instead
I've opted to make all the pointers used as part of the robust list,
including those in the robust list head and in the individual mutexes,
volatile.
in addition, the format of the robust list has been changed to point
back to the head at the end, rather than ending with a null pointer.
this is to match the documented kernel robust list ABI. the null
pointer, which was previously used, only worked because faults during
access terminate the robust list processing.
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/bits/alltypes.h.in | 2 | ||||
-rw-r--r-- | arch/i386/bits/alltypes.h.in | 2 | ||||
-rw-r--r-- | arch/microblaze/bits/alltypes.h.in | 2 | ||||
-rw-r--r-- | arch/mips/bits/alltypes.h.in | 2 | ||||
-rw-r--r-- | arch/or1k/bits/alltypes.h.in | 2 | ||||
-rw-r--r-- | arch/powerpc/bits/alltypes.h.in | 2 | ||||
-rw-r--r-- | arch/sh/bits/alltypes.h.in | 2 | ||||
-rw-r--r-- | arch/x32/bits/alltypes.h.in | 2 | ||||
-rw-r--r-- | arch/x86_64/bits/alltypes.h.in | 2 |
9 files changed, 9 insertions, 9 deletions
diff --git a/arch/arm/bits/alltypes.h.in b/arch/arm/bits/alltypes.h.in index bd23a6ae..0d750cc8 100644 --- a/arch/arm/bits/alltypes.h.in +++ b/arch/arm/bits/alltypes.h.in @@ -17,7 +17,7 @@ TYPEDEF long time_t; TYPEDEF long suseconds_t; TYPEDEF struct { union { int __i[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t; +TYPEDEF struct { union { int __i[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t; TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t; TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/arch/i386/bits/alltypes.h.in b/arch/i386/bits/alltypes.h.in index efd2c077..502c8822 100644 --- a/arch/i386/bits/alltypes.h.in +++ b/arch/i386/bits/alltypes.h.in @@ -31,7 +31,7 @@ TYPEDEF long time_t; TYPEDEF long suseconds_t; TYPEDEF struct { union { int __i[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t; +TYPEDEF struct { union { int __i[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t; TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t; TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/arch/microblaze/bits/alltypes.h.in b/arch/microblaze/bits/alltypes.h.in index 6bd79429..4657d14d 100644 --- a/arch/microblaze/bits/alltypes.h.in +++ b/arch/microblaze/bits/alltypes.h.in @@ -17,7 +17,7 @@ TYPEDEF long time_t; TYPEDEF long suseconds_t; TYPEDEF struct { union { int __i[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t; +TYPEDEF struct { union { int __i[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t; TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t; TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/arch/mips/bits/alltypes.h.in b/arch/mips/bits/alltypes.h.in index 6bd79429..4657d14d 100644 --- a/arch/mips/bits/alltypes.h.in +++ b/arch/mips/bits/alltypes.h.in @@ -17,7 +17,7 @@ TYPEDEF long time_t; TYPEDEF long suseconds_t; TYPEDEF struct { union { int __i[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t; +TYPEDEF struct { union { int __i[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t; TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t; TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/arch/or1k/bits/alltypes.h.in b/arch/or1k/bits/alltypes.h.in index bd23a6ae..0d750cc8 100644 --- a/arch/or1k/bits/alltypes.h.in +++ b/arch/or1k/bits/alltypes.h.in @@ -17,7 +17,7 @@ TYPEDEF long time_t; TYPEDEF long suseconds_t; TYPEDEF struct { union { int __i[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t; +TYPEDEF struct { union { int __i[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t; TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t; TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/arch/powerpc/bits/alltypes.h.in b/arch/powerpc/bits/alltypes.h.in index e9d8dd8a..378124ca 100644 --- a/arch/powerpc/bits/alltypes.h.in +++ b/arch/powerpc/bits/alltypes.h.in @@ -17,7 +17,7 @@ TYPEDEF long time_t; TYPEDEF long suseconds_t; TYPEDEF struct { union { int __i[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t; +TYPEDEF struct { union { int __i[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t; TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t; TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/arch/sh/bits/alltypes.h.in b/arch/sh/bits/alltypes.h.in index e9d8dd8a..378124ca 100644 --- a/arch/sh/bits/alltypes.h.in +++ b/arch/sh/bits/alltypes.h.in @@ -17,7 +17,7 @@ TYPEDEF long time_t; TYPEDEF long suseconds_t; TYPEDEF struct { union { int __i[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t; +TYPEDEF struct { union { int __i[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t; TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t; TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/arch/x32/bits/alltypes.h.in b/arch/x32/bits/alltypes.h.in index b077fc93..8930efa3 100644 --- a/arch/x32/bits/alltypes.h.in +++ b/arch/x32/bits/alltypes.h.in @@ -22,7 +22,7 @@ TYPEDEF long long time_t; TYPEDEF long long suseconds_t; TYPEDEF struct { union { int __i[14]; unsigned long __s[7]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[10]; void *__p[5]; } __u; } pthread_mutex_t; +TYPEDEF struct { union { int __i[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; TYPEDEF struct { union { int __i[12]; void *__p[6]; } __u; } pthread_cond_t; TYPEDEF struct { union { int __i[14]; void *__p[7]; } __u; } pthread_rwlock_t; TYPEDEF struct { union { int __i[8]; void *__p[4]; } __u; } pthread_barrier_t; diff --git a/arch/x86_64/bits/alltypes.h.in b/arch/x86_64/bits/alltypes.h.in index 277e9448..34b7d6ac 100644 --- a/arch/x86_64/bits/alltypes.h.in +++ b/arch/x86_64/bits/alltypes.h.in @@ -22,7 +22,7 @@ TYPEDEF long time_t; TYPEDEF long suseconds_t; TYPEDEF struct { union { int __i[14]; unsigned long __s[7]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[10]; void *__p[5]; } __u; } pthread_mutex_t; +TYPEDEF struct { union { int __i[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; TYPEDEF struct { union { int __i[12]; void *__p[6]; } __u; } pthread_cond_t; TYPEDEF struct { union { int __i[14]; void *__p[7]; } __u; } pthread_rwlock_t; TYPEDEF struct { union { int __i[8]; void *__p[4]; } __u; } pthread_barrier_t; |