1
0
Fork 0
remarkable-linux/drivers/target/iscsi
Laura Abbott 254cc00e53 scsi: iscsi: target: Don't use stack buffer for scatterlist
[ Upstream commit 679fcae46c ]

Fedora got a bug report of a crash with iSCSI:

kernel BUG at include/linux/scatterlist.h:143!
...
RIP: 0010:iscsit_do_crypto_hash_buf+0x154/0x180 [iscsi_target_mod]
...
 Call Trace:
  ? iscsi_target_tx_thread+0x200/0x200 [iscsi_target_mod]
  iscsit_get_rx_pdu+0x4cd/0xa90 [iscsi_target_mod]
  ? native_sched_clock+0x3e/0xa0
  ? iscsi_target_tx_thread+0x200/0x200 [iscsi_target_mod]
  iscsi_target_rx_thread+0x81/0xf0 [iscsi_target_mod]
  kthread+0x120/0x140
  ? kthread_create_worker_on_cpu+0x70/0x70
  ret_from_fork+0x3a/0x50

This is a BUG_ON for using a stack buffer with a scatterlist.  There
are two cases that trigger this bug. Switch to using a dynamically
allocated buffer for one case and do not assign a NULL buffer in
another case.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Reviewed-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-18 09:16:21 +02:00
..
cxgbit scsi: target: iscsi: cxgbit: fix max iso npdu calculation 2018-09-05 09:26:24 +02:00
Kconfig
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iscsi_target.c scsi: iscsi: target: Don't use stack buffer for scatterlist 2018-10-18 09:16:21 +02:00
iscsi_target.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iscsi_target_auth.c scsi: target: iscsi: Use bin2hex instead of a re-implementation 2018-09-29 03:06:04 -07:00
iscsi_target_auth.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iscsi_target_configfs.c iscsi-target: fix memory leak in lio_target_tiqn_addtpg() 2017-12-20 10:10:25 +01:00
iscsi_target_datain_values.c
iscsi_target_datain_values.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iscsi_target_device.c
iscsi_target_device.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iscsi_target_erl0.c iscsi-target: Always wait for kthread_should_stop() before kthread exit 2017-05-31 15:12:57 -07:00
iscsi_target_erl0.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iscsi_target_erl1.c
iscsi_target_erl1.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iscsi_target_erl2.c target/iscsi: Fix spelling of "reallegiance" 2017-02-09 00:39:08 -08:00
iscsi_target_erl2.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iscsi_target_login.c scsi: iscsi: target: Set conn->sess to NULL when iscsi_login_set_conn_values fails 2018-10-10 08:54:23 +02:00
iscsi_target_login.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iscsi_target_nego.c iscsi-target: make sure to wake up sleeping login worker 2018-02-22 15:42:29 +01:00
iscsi_target_nego.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iscsi_target_nodeattrib.c
iscsi_target_nodeattrib.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iscsi_target_parameters.c iscsi-target: Add login_keys_workaround attribute for non RFC initiators 2017-07-11 10:56:39 -07:00
iscsi_target_parameters.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iscsi_target_seq_pdu_list.c
iscsi_target_seq_pdu_list.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iscsi_target_stat.c
iscsi_target_tmr.c target/iscsi: Fix spelling of "reallegiance" 2017-02-09 00:39:08 -08:00
iscsi_target_tmr.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iscsi_target_tpg.c scsi: target/iscsi: Make iscsit_ta_authentication() respect the output buffer size 2018-10-03 17:00:48 -07:00
iscsi_target_tpg.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iscsi_target_transport.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iscsi_target_util.c target/iscsi: Detect conn_cmd_list corruption early 2017-12-20 10:10:25 +01:00
iscsi_target_util.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00