Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 May 2009 22:30:58 +0000 (UTC)
From:      Kip Macy <kmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r192493 - stable/7/sys/kern
Message-ID:  <200905202230.n4KMUwhg046344@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmacy
Date: Wed May 20 22:30:57 2009
New Revision: 192493
URL: http://svn.freebsd.org/changeset/base/192493

Log:
  td_osd is at the end of struct thread to avoid breaking the ABI
  as a side effect it is outside of the td_startzero-td_endzero range,
  requiring it to be separately zeroed

Modified:
  stable/7/sys/kern/kern_fork.c
  stable/7/sys/kern/kern_kse.c
  stable/7/sys/kern/kern_thr.c

Modified: stable/7/sys/kern/kern_fork.c
==============================================================================
--- stable/7/sys/kern/kern_fork.c	Wed May 20 22:28:55 2009	(r192492)
+++ stable/7/sys/kern/kern_fork.c	Wed May 20 22:30:57 2009	(r192493)
@@ -507,6 +507,7 @@ again:
 
 	bcopy(&td->td_startcopy, &td2->td_startcopy,
 	    __rangeof(struct thread, td_startcopy, td_endcopy));
+	bzero(&td2->td_osd, sizeof(struct osd));
 
 	td2->td_sigstk = td->td_sigstk;
 	td2->td_sigmask = td->td_sigmask;

Modified: stable/7/sys/kern/kern_kse.c
==============================================================================
--- stable/7/sys/kern/kern_kse.c	Wed May 20 22:28:55 2009	(r192492)
+++ stable/7/sys/kern/kern_kse.c	Wed May 20 22:30:57 2009	(r192493)
@@ -1014,6 +1014,7 @@ thread_alloc_spare(struct thread *td)
 	td->td_standin = spare;
 	bzero(&spare->td_startzero,
 	    __rangeof(struct thread, td_startzero, td_endzero));
+	bzero(&spare->td_osd, sizeof(struct osd));
 	spare->td_proc = td->td_proc;
 	spare->td_ucred = crhold(td->td_ucred);
 	spare->td_flags = TDF_INMEM;

Modified: stable/7/sys/kern/kern_thr.c
==============================================================================
--- stable/7/sys/kern/kern_thr.c	Wed May 20 22:28:55 2009	(r192492)
+++ stable/7/sys/kern/kern_thr.c	Wed May 20 22:30:57 2009	(r192493)
@@ -199,6 +199,7 @@ create_thread(struct thread *td, mcontex
 	    __rangeof(struct thread, td_startzero, td_endzero));
 	bcopy(&td->td_startcopy, &newtd->td_startcopy,
 	    __rangeof(struct thread, td_startcopy, td_endcopy));
+	bzero(&newtd->td_osd, sizeof(struct osd));
 	newtd->td_proc = td->td_proc;
 	newtd->td_ucred = crhold(td->td_ucred);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905202230.n4KMUwhg046344>