Module Name: src
Committed By: riastradh
Date: Sun Apr 16 04:52:19 UTC 2023
Modified Files:
src/sys/kern: subr_pserialize.c
Log Message:
pserialize(9): Fix buggy assertion inside assertion.
If there has been a context switch, then we can't be in a pserialize
read section -- _and_ whatever we read out of curcpu() is stale, so
we can't assert anything based on it. So just delete the assertion.
Reported-by: [email protected]
https://syzkaller.appspot.com/bug?id=0c63db890575d29c6a51fb24b003d3bab1f7f04b
To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/kern/subr_pserialize.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/subr_pserialize.c
diff -u src/sys/kern/subr_pserialize.c:1.22 src/sys/kern/subr_pserialize.c:1.23
--- src/sys/kern/subr_pserialize.c:1.22 Fri Apr 14 16:51:46 2023
+++ src/sys/kern/subr_pserialize.c Sun Apr 16 04:52:19 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_pserialize.c,v 1.22 2023/04/14 16:51:46 riastradh Exp $ */
+/* $NetBSD: subr_pserialize.c,v 1.23 2023/04/16 04:52:19 riastradh Exp $ */
/*-
* Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_pserialize.c,v 1.22 2023/04/14 16:51:46 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pserialize.c,v 1.23 2023/04/16 04:52:19 riastradh Exp $");
#include <sys/param.h>
@@ -188,10 +188,8 @@ pserialize_not_in_read_section(void)
* pserialize read section because pserialize read sections
* block preemption.
*/
- if (__predict_false(ncsw != l->l_ncsw)) {
- KDASSERT(notin);
+ if (__predict_false(ncsw != l->l_ncsw))
notin = true;
- }
return notin;
}