1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00

ixgbe: prevent PBA read over eeprom word size

DPDK commit message

net/ixgbe/base: prevent untrusted loop bound
Added length check against EEPROM size in words to prevent untrusted
loop bound reported by static code analysis.

Signed-off-by: Dawid Zielinski <dawid.zielinski@intel.com>

Obtained from:	DPDK (6b58617)
MFC after:	1 week
This commit is contained in:
Dawid Zielinski 2024-09-19 20:33:37 -07:00 committed by Kevin Bowling
parent cc99441831
commit 25771c8c1a

View File

@ -713,7 +713,7 @@ s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num,
return ret_val;
}
if (length == 0xFFFF || length == 0) {
if (length == 0xFFFF || length == 0 || length > hw->eeprom.word_size) {
DEBUGOUT("NVM PBA number section invalid length\n");
return IXGBE_ERR_PBA_SECTION;
}