svn commit: r245908 - head/sys/compat/linux

Dmitry Chagin dchagin at FreeBSD.org
Fri Jan 25 14:40:55 UTC 2013


Author: dchagin
Date: Fri Jan 25 14:40:54 2013
New Revision: 245908
URL: http://svnweb.freebsd.org/changeset/base/245908

Log:
  Arithmetic on pointers takes into account the size of the type. Properly cast the pointer to avoid incorrect pointer scaling.
  
  MFC after:	1 Week

Modified:
  head/sys/compat/linux/linux_futex.c

Modified: head/sys/compat/linux/linux_futex.c
==============================================================================
--- head/sys/compat/linux/linux_futex.c	Fri Jan 25 14:36:17 2013	(r245907)
+++ head/sys/compat/linux/linux_futex.c	Fri Jan 25 14:40:54 2013	(r245908)
@@ -1203,7 +1203,7 @@ release_futexes(struct proc *p)
 
 		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;
 			}
@@ -1222,7 +1222,7 @@ release_futexes(struct proc *p)
 	}
 
 	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 svn-src-head mailing list