Re: [PATCH v6] scsi:iscsi: Fix multiple iscsi session unbind event sent to userspace

From: Dan Carpenter
Date: Wed Nov 09 2022 - 00:08:49 EST


Hi Wenchao,

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Wenchao-Hao/scsi-iscsi-Fix-multiple-iscsi-session-unbind-event-sent-to-userspace/20221107-202840
base: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
patch link: https://lore.kernel.org/r/20221108014414.3510940-1-haowenchao%40huawei.com
patch subject: [PATCH v6] scsi:iscsi: Fix multiple iscsi session unbind event sent to userspace
config: m68k-randconfig-m031-20221108
compiler: m68k-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Reported-by: Dan Carpenter <error27@xxxxxxxxx>

smatch warnings:
drivers/scsi/scsi_transport_iscsi.c:1691 iscsi_session_target_state_name() error: buffer overflow 'iscsi_session_target_state_names' 4 <= 4

vim +/iscsi_session_target_state_names +1691 drivers/scsi/scsi_transport_iscsi.c

3aa534a2c8b080 Wenchao Hao 2022-11-07 1686 static const char *iscsi_session_target_state_name(int state)
3aa534a2c8b080 Wenchao Hao 2022-11-07 1687 {
3aa534a2c8b080 Wenchao Hao 2022-11-07 1688 if (state > ISCSI_SESSION_TARGET_MAX)

Should be >=

3aa534a2c8b080 Wenchao Hao 2022-11-07 1689 return NULL;
3aa534a2c8b080 Wenchao Hao 2022-11-07 1690
3aa534a2c8b080 Wenchao Hao 2022-11-07 @1691 return iscsi_session_target_state_names[state];
3aa534a2c8b080 Wenchao Hao 2022-11-07 1692 }

--
0-DAY CI Kernel Test Service
https://01.org/lkp