From 5b86e6aea25b6fe1593026ca708305d5c7a375b9 Mon Sep 17 00:00:00 2001 From: stsp Date: Fri, 29 Mar 2024 08:19:40 +0000 Subject: [PATCH] skip dwqe_tx_proc() processing while the interface is not up Prevents a crash seen by bluhm@ while running flood ping in parallel to looping ifconfig dwqe0 down up: kernel: protection fault trap, code=0 Stopped at m_tag_delete_chain+0x30: movq 0(%rsi),%rax ok kettenis@ dlg@ patrick@ deraadt@ --- sys/dev/ic/dwqe.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/ic/dwqe.c b/sys/dev/ic/dwqe.c index 97f874d2edf..0467a4c7247 100644 --- a/sys/dev/ic/dwqe.c +++ b/sys/dev/ic/dwqe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dwqe.c,v 1.17 2024/03/04 23:50:20 bluhm Exp $ */ +/* $OpenBSD: dwqe.c,v 1.18 2024/03/29 08:19:40 stsp Exp $ */ /* * Copyright (c) 2008, 2019 Mark Kettenis * Copyright (c) 2017, 2022 Patrick Wildt @@ -593,6 +593,9 @@ dwqe_tx_proc(struct dwqe_softc *sc) struct dwqe_buf *txb; int idx, txfree; + if ((ifp->if_flags & IFF_RUNNING) == 0) + return; + bus_dmamap_sync(sc->sc_dmat, DWQE_DMA_MAP(sc->sc_txring), 0, DWQE_DMA_LEN(sc->sc_txring), BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); -- 2.20.1