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.)
This commit is contained in:
thorpej 2021-09-28 15:35:44 +00:00
parent 978ef62280
commit 4146ac03bb
1 changed files with 8 additions and 2 deletions

View File

@ -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 execve_data * restrict data,
*/
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. */