Skip to content

Commit e0dc2c1

Browse files
committed
wifi: iwlwifi: limit printed string from FW file
There's no guarantee here that the file is always with a NUL-termination, so reading the string may read beyond the end of the TLV. If that's the last TLV in the file, it can perhaps even read beyond the end of the file buffer. Fix that by limiting the print format to the size of the buffer we have. Fixes: aee1b63 ("iwlwifi: support fseq tlv and print fseq version") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250209143303.cb5f9d0c2f5d.Idec695d53c6c2234aade306f7647b576c7e3d928@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent a03e208 commit e0dc2c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/wireless/intel/iwlwifi/iwl-drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
11811181

11821182
if (tlv_len != sizeof(*fseq_ver))
11831183
goto invalid_tlv_len;
1184-
IWL_INFO(drv, "TLV_FW_FSEQ_VERSION: %s\n",
1184+
IWL_INFO(drv, "TLV_FW_FSEQ_VERSION: %.32s\n",
11851185
fseq_ver->version);
11861186
}
11871187
break;

0 commit comments

Comments
 (0)