3
0
Fork 0
forked from mirrors/linux
kernel/drivers/net/ethernet/meta
Dan Carpenter 991a1b0992 eth: fbnic: fix memory corruption in fbnic_tlv_attr_get_string()
This code is trying to ensure that the last byte of the buffer is a NUL
terminator.  However, the problem is that attr->value[] is an array of
__le32, not char, so it zeroes out 4 bytes way beyond the end of the
buffer.  Cast the buffer to char to address this.

Fixes: e5cf5107c9 ("eth: fbnic: Update fbnic_tlv_attr_get_string() to work like nla_strscpy()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Lee Trager <lee@trager.us>
Link: https://patch.msgid.link/2791d4be-ade4-4e50-9b12-33307d8410f6@stanley.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-03-10 13:17:33 -07:00
..
fbnic eth: fbnic: fix memory corruption in fbnic_tlv_attr_get_string() 2025-03-10 13:17:33 -07:00
Kconfig eth: fbnic: add CONFIG_PTP_1588_CLOCK_OPTIONAL dependency 2024-10-20 10:17:31 -05:00
Makefile