Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Make sure the robust futex head is zeroed out, sinc...



details:   https://anonhg.NetBSD.org/src/rev/b256384c5c34
branches:  trunk
changeset: 1023857:b256384c5c34
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Sep 28 15:35:44 2021 +0000

description:
Make sure the robust futex head is zeroed out, since this LWP
will live on with a different program image.  (Thanks ryo@ for
pointing out my mistake.)

diffstat:

 sys/kern/kern_exec.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 0b4412c204ce -r b256384c5c34 sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c      Tue Sep 28 15:05:42 2021 +0000
+++ b/sys/kern/kern_exec.c      Tue Sep 28 15:35:44 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exec.c,v 1.508 2021/09/28 15:05:42 thorpej Exp $  */
+/*     $NetBSD: kern_exec.c,v 1.509 2021/09/28 15:35:44 thorpej Exp $  */
 
 /*-
  * Copyright (c) 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.508 2021/09/28 15:05:42 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.509 2021/09/28 15:35:44 thorpej Exp $");
 
 #include "opt_exec.h"
 #include "opt_execfmt.h"
@@ -1212,6 +1212,12 @@
         */
        if (__predict_false(l->l_robust_head != 0)) {
                futex_release_all_lwp(l);
+               /*
+                * Since this LWP will live on with a different
+                * program image, we need to clear the robust
+                * futex list pointer here.
+                */
+               l->l_robust_head = 0;
        }
 
        /* Destroy any lwpctl info. */



Home | Main Index | Thread Index | Old Index