kernel_samsung_a53x/drivers/net/ethernet/brocade/bna
Bui Quang Minh 8bc6e5d983 bna: ensure the copied buf is NUL terminated
[ Upstream commit 8c34096c7fdf272fd4c0c37fe411cd2e3ed0ee9f ]

Currently, we allocate a nbytes-sized kernel buffer and copy nbytes from
userspace to that buffer. Later, we use sscanf on this buffer but we don't
ensure that the string is terminated inside the buffer, this can lead to
OOB read when using sscanf. Fix this issue by using memdup_user_nul
instead of memdup_user.

Fixes: 7afc5dbde091 ("bna: Add debugfs interface.")
Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
Link: https://lore.kernel.org/r/20240424-fix-oob-read-v2-2-f1f1b53a10f4@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 11:32:42 +01:00
..
bfa_cee.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_cee.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_cs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_defs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_defs_cna.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_defs_mfg_comm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_defs_status.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_ioc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_ioc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_ioc_ct.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_msgq.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_msgq.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfi.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfi_cna.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfi_enet.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfi_reg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bna.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bna_enet.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bna_hw_defs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bna_tx_rx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bna_types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bnad.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bnad.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bnad_debugfs.c bna: ensure the copied buf is NUL terminated 2024-11-19 11:32:42 +01:00
bnad_ethtool.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cna.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cna_fwimg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00