Module Name: src Committed By: thorpej Date: Tue Sep 28 15:35:44 UTC 2021
Modified Files: src/sys/kern: kern_exec.c Log Message: 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.) To generate a diff of this commit: cvs rdiff -u -r1.508 -r1.509 src/sys/kern/kern_exec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/kern_exec.c diff -u src/sys/kern/kern_exec.c:1.508 src/sys/kern/kern_exec.c:1.509 --- src/sys/kern/kern_exec.c:1.508 Tue Sep 28 15:05:42 2021 +++ src/sys/kern/kern_exec.c Tue Sep 28 15:35:44 2021 @@ -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 @@ execve_runproc(struct lwp *l, struct exe */ 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. */