linux/drivers/target
Maurizio Lombardi d8ab68bdb2 scsi: target: Fix NULL pointer dereference in core_scsi3_decode_spec_i_port()
The function core_scsi3_decode_spec_i_port(), in its error code path,
unconditionally calls core_scsi3_lunacl_undepend_item() passing the
dest_se_deve pointer, which may be NULL.

This can lead to a NULL pointer dereference if dest_se_deve remains
unset.

SPC-3 PR SPEC_I_PT: Unable to locate dest_tpg
Unable to handle kernel paging request at virtual address dfff800000000012
Call trace:
  core_scsi3_lunacl_undepend_item+0x2c/0xf0 [target_core_mod] (P)
  core_scsi3_decode_spec_i_port+0x120c/0x1c30 [target_core_mod]
  core_scsi3_emulate_pro_register+0x6b8/0xcd8 [target_core_mod]
  target_scsi3_emulate_pr_out+0x56c/0x840 [target_core_mod]

Fix this by adding a NULL check before calling
core_scsi3_lunacl_undepend_item()

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Link: https://lore.kernel.org/r/20250612101556.24829-1-mlombard@redhat.com
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Reviewed-by: John Meneghini <jmeneghi@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-06-16 14:35:57 -04:00
..
iscsi treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
loopback scsi: target: tcm_loop: Fix wrong abort tag 2025-03-17 22:04:21 -04:00
sbp move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
tcm_fc move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
tcm_remote
Kconfig
Makefile
target_core_alua.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
target_core_alua.h
target_core_configfs.c scsi: target: Remove size arguments when calling strscpy() 2025-04-11 21:58:53 -04:00
target_core_device.c scsi: target: Move delayed/ordered tracking to per CPU 2025-04-28 21:47:55 -04:00
target_core_fabric_configfs.c
target_core_fabric_lib.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
target_core_file.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
target_core_file.h
target_core_hba.c
target_core_iblock.c block: split struct bio_integrity_payload 2025-03-03 11:17:52 -07:00
target_core_iblock.h
target_core_internal.h
target_core_pr.c scsi: target: Fix NULL pointer dereference in core_scsi3_decode_spec_i_port() 2025-06-16 14:35:57 -04:00
target_core_pr.h
target_core_pscsi.c block: remove bio_add_pc_page 2025-01-04 15:27:35 -07:00
target_core_pscsi.h
target_core_rd.c
target_core_rd.h
target_core_sbc.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
target_core_spc.c scsi: target: core: Constify struct target_opcode_descriptor 2025-05-20 22:11:03 -04:00
target_core_stat.c scsi: target: Move I/O path stats to per CPU 2025-04-28 21:47:55 -04:00
target_core_tmr.c
target_core_tpg.c
target_core_transport.c scsi: target: Move delayed/ordered tracking to per CPU 2025-04-28 21:47:55 -04:00
target_core_ua.c
target_core_ua.h
target_core_user.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
target_core_xcopy.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
target_core_xcopy.h