Author: ivadasz Date: Mon Sep 19 22:11:34 2016 New Revision: 306001 URL: https://svnweb.freebsd.org/changeset/base/306001
Log: [iwm] Fix off-by-one check in iwm_read_firmware(). This fixes a potential buffer overrun in the firmware parsing code. Reported by: Coverity Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7931 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Sep 19 22:08:47 2016 (r306000) +++ head/sys/dev/iwm/if_iwm.c Mon Sep 19 22:11:34 2016 (r306001) @@ -739,7 +739,7 @@ iwm_read_firmware(struct iwm_softc *sc, } capa = (const struct iwm_ucode_capa *)tlv_data; idx = le32toh(capa->api_index); - if (idx > howmany(IWM_NUM_UCODE_TLV_CAPA, 32)) { + if (idx >= howmany(IWM_NUM_UCODE_TLV_CAPA, 32)) { device_printf(sc->sc_dev, "unsupported API index %d\n", idx); goto parse_out; _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"