⬢ DragonFlyBSD Kernel Audit
DF-2319 / fix.diff
← back to finding ↓ download raw
--- a/sys/bus/pccard/pccard_cis.c
+++ b/sys/bus/pccard/pccard_cis.c
@@ -876,6 +876,16 @@
 			u_int power, timing, iospace, irq, memspace, misc;
 			struct pccard_config_entry *cfe;
 
+			/* DF-2319: a CFTABLE_ENTRY is only meaningful after a
+			 * CISTPL_CONFIG set default_cfe and a function exists;
+			 * before the first CONFIG (or after the LONGLINK_MFC
+			 * reset at CISTPL_END) both are NULL and were
+			 * dereferenced at :907/:916. */
+			if (state->default_cfe == NULL || state->pf == NULL) {
+				state->card->error++;
+				break;
+			}
+
 			idx = 0;
 
 			reg = pccard_tuple_read_1(tuple, idx);