Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Mar 2018 04:46:58 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r330148 - stable/11/sys/dev/iwm
Message-ID:  <201803010446.w214kwK9000654@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Thu Mar  1 04:46:58 2018
New Revision: 330148
URL: https://svnweb.freebsd.org/changeset/base/330148

Log:
  MFC r306001
  
  [iwm] Fix off-by-one check in iwm_read_firmware().
  
  This fixes a potential buffer overrun in the firmware parsing code.

Modified:
  stable/11/sys/dev/iwm/if_iwm.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/iwm/if_iwm.c
==============================================================================
--- stable/11/sys/dev/iwm/if_iwm.c	Thu Mar  1 04:44:17 2018	(r330147)
+++ stable/11/sys/dev/iwm/if_iwm.c	Thu Mar  1 04:46:58 2018	(r330148)
@@ -739,7 +739,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode
 			}
 			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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803010446.w214kwK9000654>