linux/drivers/scsi/bfa
Bui Quang Minh 13d0cecb46 scsi: bfa: Ensure the copied buf is NUL terminated
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: 9f30b67475 ("bfa: replace 2 kzalloc/copy_from_user by memdup_user")
Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
Link: https://lore.kernel.org/r/20240424-fix-oob-read-v2-3-f1f1b53a10f4@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2024-05-06 21:19:24 -04:00
..
bfa_core.c scsi: bfa: Fix function pointer type mismatch for hcb_qe->cbfn 2024-02-26 21:16:48 -05:00
bfa_cs.h scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_defs_fcs.h
bfa_defs_svc.h scsi: bfa: Fix typo 2021-05-21 17:00:21 -04:00
bfa_defs.h
bfa_fc.h scsi: bfa: Replace one-element array with flexible-array member in struct fc_rscn_pl_s 2023-08-21 17:13:56 -04:00
bfa_fcbuild.c scsi: bfa: Replace one-element array with flexible-array member in struct fc_rscn_pl_s 2023-08-21 17:13:56 -04:00
bfa_fcbuild.h
bfa_fcpim.c scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_fcpim.h scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_fcs_fcpim.c scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_fcs_lport.c scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_fcs_rport.c scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_fcs.c scsi: bfa: Replace all non-returning strlcpy() with strscpy() 2023-05-16 21:38:36 -04:00
bfa_fcs.h scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_hw_cb.c
bfa_hw_ct.c
bfa_ioc_cb.c
bfa_ioc_ct.c scsi: bfa: Demote non-compliant kerneldoc headers to standard comments 2020-07-24 22:32:07 -04:00
bfa_ioc.c scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_ioc.h scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_modules.h
bfa_plog.h
bfa_port.c scsi: bfa: Staticify local functions 2020-07-24 22:31:56 -04:00
bfa_port.h
bfa_svc.c scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_svc.h scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa.h scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfad_attr.c scsi: bfa: Replace all non-returning strlcpy() with strscpy() 2023-05-16 21:38:36 -04:00
bfad_bsg.c scsi: bfa: Fix function pointer type mismatch for hcb_qe->cbfn 2024-02-26 21:16:48 -05:00
bfad_bsg.h
bfad_debugfs.c scsi: bfa: Ensure the copied buf is NUL terminated 2024-05-06 21:19:24 -04:00
bfad_drv.h scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfad_im.c scsi: bfa: Replace all non-returning strlcpy() with strscpy() 2023-05-16 21:38:36 -04:00
bfad_im.h scsi: bfa: Convert bfad_reset_sdev_bflags() from a macro into a function 2022-11-08 03:34:39 +00:00
bfad.c scsi: bfa: Replace all non-returning strlcpy() with strscpy() 2023-05-16 21:38:36 -04:00
bfi_ms.h
bfi_reg.h
bfi.h
Makefile