about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2013-05-10 20:28:40 +0200
committerAndreas Jaeger <aj@suse.de>2013-05-10 20:28:40 +0200
commit8a67a4b3435d8471523d3ae4f7cb46cf9b8d72d9 (patch)
treeef04f3f9462ec0ee800c05bca3ec18ca04100b2e
parent51df539d98c5906c325f73b0436f444a86818770 (diff)
downloadglibc-8a67a4b3435d8471523d3ae4f7cb46cf9b8d72d9.tar.gz
glibc-8a67a4b3435d8471523d3ae4f7cb46cf9b8d72d9.tar.xz
glibc-8a67a4b3435d8471523d3ae4f7cb46cf9b8d72d9.zip
Fix integer overflow in sysdeps/unix/sysv/linux/bits/sched.h
	[BZ #15448]
	* sysdeps/unix/sysv/linux/bits/sched.h (__CPU_SET_S)
	(__CPU_CLR_S, __CPU_ISSET_S): Avoid integer overflow.
-rw-r--r--ChangeLog6
-rw-r--r--NEWS3
-rw-r--r--sysdeps/unix/sysv/linux/bits/sched.h6
3 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index a7e4b253d1..4226597f7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-05-10  Andreas Jaeger  <aj@suse.de>
+
+	[BZ #15448]
+	* sysdeps/unix/sysv/linux/bits/sched.h (__CPU_SET_S)
+	(__CPU_CLR_S, __CPU_ISSET_S): Avoid integer overflow.
+
 2013-05-10  Joseph Myers  <joseph@codesourcery.com>
 
 	* math/gen-libm-test.pl (adjust_arg): New function.
diff --git a/NEWS b/NEWS
index 87d9128700..5c005bc2bf 100644
--- a/NEWS
+++ b/NEWS
@@ -16,7 +16,8 @@ Version 2.18
   15055, 15062, 15078, 15084, 15085, 15086, 15160, 15214, 15221, 15232,
   15234, 15283, 15285, 15287, 15304, 15305, 15307, 15309, 15327, 15330,
   15335, 15336, 15337, 15342, 15346, 15359, 15361, 15366, 15380, 15394,
-  15395, 15405, 15406, 15409, 15416, 15418, 15419, 15423, 15426, 15429.
+  15395, 15405, 15406, 15409, 15416, 15418, 15419, 15423, 15426, 15429,
+  15448.
 
 * CVE-2013-0242 Buffer overrun in regexp matcher has been fixed (Bugzilla
   #15078).
diff --git a/sysdeps/unix/sysv/linux/bits/sched.h b/sysdeps/unix/sysv/linux/bits/sched.h
index 5e8057b62e..e42dee8e62 100644
--- a/sysdeps/unix/sysv/linux/bits/sched.h
+++ b/sysdeps/unix/sysv/linux/bits/sched.h
@@ -144,21 +144,21 @@ typedef struct
 # define __CPU_SET_S(cpu, setsize, cpusetp) \
   (__extension__							      \
    ({ size_t __cpu = (cpu);						      \
-      __cpu < 8 * (setsize)						      \
+      __cpu / 8 < (setsize)						      \
       ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]		      \
 	 |= __CPUMASK (__cpu))						      \
       : 0; }))
 # define __CPU_CLR_S(cpu, setsize, cpusetp) \
   (__extension__							      \
    ({ size_t __cpu = (cpu);						      \
-      __cpu < 8 * (setsize)						      \
+      __cpu / 8 < (setsize)						      \
       ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]		      \
 	 &= ~__CPUMASK (__cpu))						      \
       : 0; }))
 # define __CPU_ISSET_S(cpu, setsize, cpusetp) \
   (__extension__							      \
    ({ size_t __cpu = (cpu);						      \
-      __cpu < 8 * (setsize)						      \
+      __cpu / 8 < (setsize)						      \
       ? ((((const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]	      \
 	  & __CPUMASK (__cpu))) != 0					      \
       : 0; }))