Module Name: src Committed By: martin Date: Wed Feb 22 18:52:46 UTC 2023
Modified Files: src/sys/net [netbsd-10]: route.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #99): sys/net/route.c: revision 1.236 route(4): Work around deadlock in rt_free wait path. PR kern/56844 To generate a diff of this commit: cvs rdiff -u -r1.235 -r1.235.2.1 src/sys/net/route.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/net/route.c diff -u src/sys/net/route.c:1.235 src/sys/net/route.c:1.235.2.1 --- src/sys/net/route.c:1.235 Fri Nov 25 08:39:32 2022 +++ src/sys/net/route.c Wed Feb 22 18:52:45 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: route.c,v 1.235 2022/11/25 08:39:32 knakahara Exp $ */ +/* $NetBSD: route.c,v 1.235.2.1 2023/02/22 18:52:45 martin Exp $ */ /*- * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ #endif #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.235 2022/11/25 08:39:32 knakahara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.235.2.1 2023/02/22 18:52:45 martin Exp $"); #include <sys/param.h> #ifdef RTFLUSH_DEBUG @@ -642,8 +642,17 @@ static bool rt_wait_ok(void) { + /* + * This originally returned !cpu_softintr_p(), but that doesn't + * work: the caller may hold a lock (probably softnet lock) + * that a softint is waiting for, in which case waiting here + * would cause a deadlock. See https://gnats.netbsd.org/56844 + * for details. For now, until the locking paths are sorted + * out, we just disable the waiting option altogether and + * always defer to workqueue. + */ KASSERT(!cpu_intr_p()); - return !cpu_softintr_p(); + return false; } void