From 3d611ba443d95431c04ed3c0d5fbcd0ff47005b0 Mon Sep 17 00:00:00 2001 From: mvs Date: Mon, 5 Feb 2024 18:27:47 +0000 Subject: [PATCH] Don't send route messages while rebooting after panic. Syskaller exposed [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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index e76ec366f59..6677cf0251a 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -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); } -- 2.20.1