Don't send route messages while rebooting after panic. Syskaller exposed
authormvs <mvs@openbsd.org>
Mon, 5 Feb 2024 18:27:47 +0000 (18:27 +0000)
committermvs <mvs@openbsd.org>
Mon, 5 Feb 2024 18:27:47 +0000 (18:27 +0000)
[1] that if_downall() tries to send route messages and triggers panic
again but in knote(9) layer.

1. https://syzkaller.appspot.com/bug?extid=d19060a65721eb432a72

ok bluhm

sys/net/if.c

index e76ec36..6677cf0 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if.c,v 1.716 2024/01/06 11:42:11 bluhm Exp $  */
+/*     $OpenBSD: if.c,v 1.717 2024/02/05 18:27:47 mvs Exp $    */
 /*     $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $  */
 
 /*
@@ -1788,8 +1788,10 @@ if_linkstate(struct ifnet *ifp)
 {
        NET_ASSERT_LOCKED();
 
-       rtm_ifchg(ifp);
-       rt_if_track(ifp);
+       if (panicstr != NULL) {
+               rtm_ifchg(ifp);
+               rt_if_track(ifp);
+       }
 
        if_hooks_run(&ifp->if_linkstatehooks);
 }