Skip to content
Commit a8569f76 authored by Hristo Venev's avatar Hristo Venev Committed by Greg Kroah-Hartman
Browse files

be2net: Fix buffer overflow in be_get_module_eeprom

[ Upstream commit d7241f67 ]

be_cmd_read_port_transceiver_data assumes that it is given a buffer that
is at least PAGE_DATA_LEN long, or twice that if the module supports SFF
8472. However, this is not always the case.

Fix this by passing the desired offset and length to
be_cmd_read_port_transceiver_data so that we only copy the bytes once.

Fixes: e36edd9d

 ("be2net: add ethtool "-m" option support")
Signed-off-by: default avatarHristo Venev <hristo@venev.name>
Link: https://lore.kernel.org/r/20220716085134.6095-1-hristo@venev.name
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 91d6aa19
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment