[Midnightbsd-cvs] src [8722] trunk/sys/compat/linux/linux_futex.c: arithmetic on points takes into account the size of the type.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Sep 25 18:33:18 EDT 2016


Revision: 8722
          http://svnweb.midnightbsd.org/src/?rev=8722
Author:   laffer1
Date:     2016-09-25 18:33:17 -0400 (Sun, 25 Sep 2016)
Log Message:
-----------
arithmetic on points takes into account the size of the type.  properly cast the pointer to avoid scaling issues.

Modified Paths:
--------------
    trunk/sys/compat/linux/linux_futex.c

Modified: trunk/sys/compat/linux/linux_futex.c
===================================================================
--- trunk/sys/compat/linux/linux_futex.c	2016-09-25 22:32:49 UTC (rev 8721)
+++ trunk/sys/compat/linux/linux_futex.c	2016-09-25 22:33:17 UTC (rev 8722)
@@ -1194,7 +1194,7 @@
 
 		if (entry != pending)
 			if (handle_futex_death(p,
-			    (uint32_t *)entry + futex_offset, pi)) {
+			    (uint32_t *)((caddr_t)entry + futex_offset), pi)) {
 				LIN_SDT_PROBE0(futex, release_futexes, return);
 				return;
 			}
@@ -1213,7 +1213,7 @@
 	}
 
 	if (pending)
-		handle_futex_death(p, (uint32_t *)pending + futex_offset, pip);
+		handle_futex_death(p, (uint32_t *)((caddr_t)pending + futex_offset), pip);
 
 	LIN_SDT_PROBE0(futex, release_futexes, return);
 }



More information about the Midnightbsd-cvs mailing list