Author: kib
Date: Sat Jun 25 11:31:25 2016
New Revision: 302195
URL: https://svnweb.freebsd.org/changeset/base/302195

Log:
  Do not clear robust lists pointers on fork.  The forked child thread
  lists must be functional.
  
  Reported by:  Daniel Engberg <[email protected]>,
        Guy Yur <[email protected]>
  Tested by:    Guy Yur <[email protected]>
  Sponsored by: The FreeBSD Foundation
  Approved by:  re (gjb), including the KBI change

Modified:
  head/sys/kern/kern_thr.c
  head/sys/sys/proc.h

Modified: head/sys/kern/kern_thr.c
==============================================================================
--- head/sys/kern/kern_thr.c    Sat Jun 25 11:30:40 2016        (r302194)
+++ head/sys/kern/kern_thr.c    Sat Jun 25 11:31:25 2016        (r302195)
@@ -234,6 +234,7 @@ thread_create(struct thread *td, struct 
        bcopy(&td->td_startcopy, &newtd->td_startcopy,
            __rangeof(struct thread, td_startcopy, td_endcopy));
        newtd->td_proc = td->td_proc;
+       newtd->td_rb_list = newtd->td_rbp_list = newtd->td_rb_inact = 0;
        thread_cow_get(newtd, td);
 
        error = initialize_thread(newtd, thunk);

Modified: head/sys/sys/proc.h
==============================================================================
--- head/sys/sys/proc.h Sat Jun 25 11:30:40 2016        (r302194)
+++ head/sys/sys/proc.h Sat Jun 25 11:31:25 2016        (r302195)
@@ -282,9 +282,6 @@ struct thread {
        int             td_no_sleeping; /* (k) Sleeping disabled count. */
        int             td_dom_rr_idx;  /* (k) RR Numa domain selection. */
        void            *td_su;         /* (k) FFS SU private */
-       uintptr_t       td_rb_list;     /* (k) Robust list head. */
-       uintptr_t       td_rbp_list;    /* (k) Robust priv list head. */
-       uintptr_t       td_rb_inact;    /* (k) Current in-action mutex loc. */
 #define        td_endzero td_sigmask
 
 /* Copied during fork1() or create_thread(). */
@@ -298,6 +295,9 @@ struct thread {
        u_char          td_base_user_pri; /* (t) Base user pri */
        u_int           td_dbg_sc_code; /* (c) Syscall code to debugger. */
        u_int           td_dbg_sc_narg; /* (c) Syscall arg count to debugger.*/
+       uintptr_t       td_rb_list;     /* (k) Robust list head. */
+       uintptr_t       td_rbp_list;    /* (k) Robust priv list head. */
+       uintptr_t       td_rb_inact;    /* (k) Current in-action mutex loc. */
 #define        td_endcopy td_pcb
 
 /*
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to