The minimum length and the maximum length required were both too low,
due to an error in accounting for the 4-byte packet length+flags header.
Patch by Christian Ehrhardt
-/* $OpenBSD: if_iwm.c,v 1.386 2022/01/04 15:53:57 stsp Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.387 2022/01/04 15:55:28 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
break;
len = sizeof(pkt->len_n_flags) + iwm_rx_packet_len(pkt);
- if (len < sizeof(pkt->hdr) ||
- len > (IWM_RBUF_SIZE - offset - minsz))
+ if (len < minsz || len > (IWM_RBUF_SIZE - offset))
break;
if (code == IWM_REPLY_RX_MPDU_CMD && ++nmpdu == 1) {
-/* $OpenBSD: if_iwx.c,v 1.129 2022/01/04 15:53:57 stsp Exp $ */
+/* $OpenBSD: if_iwx.c,v 1.130 2022/01/04 15:55:28 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
}
len = sizeof(pkt->len_n_flags) + iwx_rx_packet_len(pkt);
- if (len < sizeof(pkt->hdr) ||
- len > (IWX_RBUF_SIZE - offset - minsz))
+ if (len < minsz || len > (IWX_RBUF_SIZE - offset))
break;
if (code == IWX_REPLY_RX_MPDU_CMD && ++nmpdu == 1) {