OpenCloudOS-Kernel/drivers/net/ethernet/broadcom
Kees Cook d3e599c090 bnxt: Do not read past the end of test names
Test names were being concatenated based on a offset beyond the end of
the first name, which tripped the buffer overflow detection logic:

 detected buffer overflow in strnlen
 [...]
 Call Trace:
 bnxt_ethtool_init.cold+0x18/0x18

Refactor struct hwrm_selftest_qlist_output to use an actual array,
and adjust the concatenation to use snprintf() rather than a series of
strncat() calls.

Reported-by: Niklas Cassel <Niklas.Cassel@wdc.com>
Link: https://lore.kernel.org/lkml/Y8F%2F1w1AZTvLglFX@x1-carbon/
Tested-by: Niklas Cassel <Niklas.Cassel@wdc.com>
Fixes: eb51365846 ("bnxt_en: Add basic ethtool -t selftest support.")
Cc: Michael Chan <michael.chan@broadcom.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-01-20 12:52:29 +00:00
..
bnx2x Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-29 13:04:52 -08:00
bnxt bnxt: Do not read past the end of test names 2023-01-20 12:52:29 +00:00
genet net: bcmgenet: Remove the unused function 2022-12-09 19:46:52 -08:00
Kconfig net: broadcom: Add PTP_1588_CLOCK_OPTIONAL dependency for BCMGENET under ARCH_BCM2835 2022-11-30 20:37:03 -08:00
Makefile net: ethernet: bgmac: Remove -Warray-bounds exception 2022-10-07 08:50:07 +01:00
b44.c net: Remove the obsolte u64_stats_fetch_*_irq() users (drivers). 2022-10-28 20:13:54 -07:00
b44.h
bcm63xx_enet.c net: ethernet: broadcom: bcm63xx_enet: Drop empty platform remove function 2022-12-30 07:28:49 +00:00
bcm63xx_enet.h bcm63xx_enet: convert to build_skb 2021-01-07 12:39:53 -08:00
bcm4908_enet.c net: broadcom: bcm4908_enet: report queued and transmitted bytes 2022-11-02 20:38:04 -07:00
bcm4908_enet.h net: broadcom: rename BCM4908 driver & update DT binding 2021-02-11 15:04:17 -08:00
bcmsysport.c net: systemport: Add support for RDMA overflow statistic counter 2022-10-31 20:05:03 -07:00
bcmsysport.h net: systemport: Add support for RDMA overflow statistic counter 2022-10-31 20:05:03 -07:00
bgmac-bcma-mdio.c net: ethernet: bgmac: Fix refcount leak in bcma_mdio_mii_register 2022-06-06 14:38:15 -07:00
bgmac-bcma.c net: bgmac: Fix an erroneous kfree() in bgmac_remove() 2022-06-14 19:16:36 -07:00
bgmac-platform.c Revert "net: ethernet: bgmac: Use devm_platform_ioremap_resource_byname" 2022-02-17 08:45:34 -08:00
bgmac.c net: bgmac: Drop free_netdev() from bgmac_enet_remove() 2022-11-11 19:48:35 -08:00
bgmac.h net: bgmac: remove a copy of the NAPI_POLL_WEIGHT define 2022-04-29 11:56:41 +01:00
bnx2.c skbuff: Introduce slab_build_skb() 2022-12-09 19:47:41 -08:00
bnx2.h
bnx2_fw.h
cnic.c dma-mapping updates for Linux 2.6 2022-12-13 09:05:19 -08:00
cnic.h
cnic_defs.h
cnic_if.h
sb1250-mac.c eth: switch to netif_napi_add_weight() 2022-05-08 11:33:57 +01:00
tg3.c ptp: tg3: convert .adjfreq to .adjfine 2022-11-11 10:58:39 +00:00
tg3.h tg3: Read VPD with pci_vpd_alloc() 2021-08-20 15:49:00 -05:00
unimac.h net: broadcom: share header defining UniMAC registers 2021-01-08 19:17:28 -08:00