Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Fix null pointer dereference in msk_rxeof.
details: https://anonhg.NetBSD.org/src/rev/f27729ff0e9b
branches: trunk
changeset: 780695:f27729ff0e9b
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sat Aug 04 03:46:30 2012 +0000
description:
Fix null pointer dereference in msk_rxeof.
This triggers when processing an RX interrupt that was queued while
stopping the interface, which caused my machine to panic last night.
In this case, just drop the packet.
>From OpenBSD's if_msk.c rev. 1.71.
diffstat:
sys/dev/pci/if_msk.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (30 lines):
diff -r d8b0b039c48b -r f27729ff0e9b sys/dev/pci/if_msk.c
--- a/sys/dev/pci/if_msk.c Fri Aug 03 21:51:11 2012 +0000
+++ b/sys/dev/pci/if_msk.c Sat Aug 04 03:46:30 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.41 2012/07/22 14:33:02 matt Exp $ */
+/* $NetBSD: if_msk.c,v 1.42 2012/08/04 03:46:30 riastradh Exp $ */
/* $OpenBSD: if_msk.c,v 1.42 2007/01/17 02:43:02 krw Exp $ */
/*
@@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.41 2012/07/22 14:33:02 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.42 2012/08/04 03:46:30 riastradh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1703,8 +1703,10 @@
MSK_CDRXSYNC(sc_if, cur, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
cur_rx = &sc_if->sk_cdata.sk_rx_chain[cur];
+ if (cur_rx->sk_mbuf == NULL)
+ return;
+
dmamap = sc_if->sk_cdata.sk_rx_jumbo_map;
-
bus_dmamap_sync(sc_if->sk_softc->sc_dmatag, dmamap, 0,
dmamap->dm_mapsize, BUS_DMASYNC_POSTREAD);
Home |
Main Index |
Thread Index |
Old Index