linux/drivers/scsi/qedf
Oleksandr Natalenko 25dbc20dea scsi: qedf: Do not touch __user pointer in qedf_dbg_fp_int_cmd_read() directly
The qedf_dbg_fp_int_cmd_read() function invokes sprintf() directly on a
__user pointer, which may crash the kernel.

Avoid doing that by vmalloc()'ating a buffer for scnprintf() and then
calling simple_read_from_buffer() which does a proper copy_to_user() call.

Fixes: 61d8658b4a ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.")
Link: https://lore.kernel.org/lkml/20230724120241.40495-1-oleksandr@redhat.com/
Link: https://lore.kernel.org/linux-scsi/20230726101236.11922-1-skashyap@marvell.com/
Cc: Saurav Kashyap <skashyap@marvell.com>
Cc: Rob Evers <revers@redhat.com>
Cc: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: David Laight <David.Laight@ACULAB.COM>
Cc: Jozef Bacik <jobacik@redhat.com>
Cc: Laurence Oberman <loberman@redhat.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: GR-QLogic-Storage-Upstream@marvell.com
Cc: linux-scsi@vger.kernel.org
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Tested-by: Laurence Oberman <loberman@redhat.com>
Acked-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Oleksandr Natalenko <oleksandr@redhat.com>
Link: https://lore.kernel.org/r/20230731084034.37021-4-oleksandr@redhat.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2023-07-31 14:42:59 -04:00
..
drv_fcoe_fw_funcs.c qed: Remove e4_ and _e4 from FW HSI 2021-10-04 12:55:48 +01:00
drv_fcoe_fw_funcs.h qed: Remove e4_ and _e4 from FW HSI 2021-10-04 12:55:48 +01:00
drv_scsi_fw_funcs.c
drv_scsi_fw_funcs.h
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile
qedf.h scsi: qedf: Stop using the SCSI pointer 2022-02-22 21:11:05 -05:00
qedf_attr.c scsi: qedf: Remove unnecessary code 2022-04-25 23:36:31 -04:00
qedf_dbg.c scsi: qedf: Use vzalloc() instead of vmalloc()/memset(0) 2021-05-21 16:31:17 -04:00
qedf_dbg.h scsi: qedf: Do not touch __user pointer in qedf_dbg_fp_int_cmd_read() directly 2023-07-31 14:42:59 -04:00
qedf_debugfs.c scsi: qedf: Do not touch __user pointer in qedf_dbg_fp_int_cmd_read() directly 2023-07-31 14:42:59 -04:00
qedf_els.c qed: Remove e4_ and _e4 from FW HSI 2021-10-04 12:55:48 +01:00
qedf_fip.c scsi: qedf: Remove redundant initialization of variable rc 2020-06-02 21:44:14 -04:00
qedf_hsi.h
qedf_io.c scsi: qedf: Fix typo in comment 2022-05-23 23:24:10 -04:00
qedf_main.c scsi: qedf: Fix NULL dereference in error handling 2023-05-08 07:19:20 -04:00
qedf_version.h