Maurizio Lombardi
a0fde512f7
scsi: target: core: Fix invalid memory access
...
nr_attrs should start counting from zero, otherwise we will end up
dereferencing an invalid memory address.
$ targetcli /loopback create
general protection fault
RIP: 0010:configfs_create_file+0x12/0x70
Call Trace:
<TASK>
configfs_attach_item.part.0+0x5f/0x150
configfs_attach_group.isra.0+0x49/0x120
configfs_mkdir+0x24f/0x4d0
vfs_mkdir+0x192/0x240
do_mkdirat+0x131/0x160
__x64_sys_mkdir+0x48/0x70
do_syscall_64+0x5c/0x90
Fixes: 31177b74790c ("scsi: target: core: Add RTPI attribute for target port")
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Link: https://lore.kernel.org/r/20230407130033.556644-1-mlombard@redhat.com
Acked-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2023-04-11 20:49:43 -04:00
..
2023-03-31 21:45:14 -04:00
2023-03-24 20:44:14 -04:00
2023-03-16 23:36:36 -04:00
2023-03-16 23:36:36 -04:00
2023-03-16 23:36:37 -04:00
2023-03-16 23:36:37 -04:00
2023-03-16 23:36:37 -04:00
2023-03-09 21:29:23 -05:00
2023-03-16 23:36:35 -04:00
2023-03-24 17:39:15 -04:00
2023-04-11 20:49:43 -04:00
2020-07-08 00:14:34 -04:00
2023-02-03 08:20:55 -07:00
2022-12-14 08:58:51 -08:00
2021-03-04 17:37:02 -05:00
2023-03-24 17:39:15 -04:00
2023-03-09 21:29:23 -05:00
2021-05-15 14:14:28 -04:00
2023-01-13 21:34:09 -05:00
2022-03-01 22:21:49 -05:00
2021-04-05 23:26:38 -04:00
2021-04-05 23:26:38 -04:00
2022-11-24 03:22:58 +00:00
2023-04-02 21:35:52 -04:00
2023-03-09 21:29:23 -05:00
2023-03-24 17:32:23 -04:00
2023-03-24 17:39:15 -04:00
2023-03-24 17:32:23 -04:00
2020-02-21 17:37:16 -05:00
2023-02-09 16:51:39 -08:00
2023-03-24 17:32:23 -04:00
2022-11-24 02:16:19 +00:00