diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index b9145cdefe8a..d5356981bbcf 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -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 -__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. */