diff options
author | Daniel Micay <danielmicay@gmail.com> | 2016-09-19 07:57:43 -0400 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2021-09-27 21:17:05 +0800 |
commit | 42021c199c896dc5084c849e2b1d109c1517495e (patch) | |
tree | 81713367e847b745d69297fabba10ca59f12b0eb | |
parent | 46ff4c619a16315a69302c65d3293ad73cb29fe1 (diff) |
[GrapheneOS] fix undefined out-of-bounds accesses in sched.h
Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
Change-Id: I064c48fff5dc46543a38160aa572602bba07d849
-rw-r--r-- | libc/include/sched.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libc/include/sched.h b/libc/include/sched.h index 3260231cf..00c2a4a45 100644 --- a/libc/include/sched.h +++ b/libc/include/sched.h @@ -70,7 +70,10 @@ int setns(int __fd, int __ns_type) __INTRODUCED_IN(21); #define __CPU_MASK(x) ((__CPU_BITTYPE)1 << ((x) & (__CPU_BITS - 1))) typedef struct { - __CPU_BITTYPE __bits[ CPU_SETSIZE / __CPU_BITS ]; + union { + __CPU_BITTYPE __bits_minimum[ CPU_SETSIZE / __CPU_BITS ]; + __CPU_BITTYPE __bits[0]; + }; } cpu_set_t; int sched_setaffinity(pid_t __pid, size_t __set_size, const cpu_set_t* __set); |