Nick Black
4b57abe52d
scsi: iscsi: Don't destroy session if there are outstanding connections
[ Upstream commit 54155ed419 ]
A faulty userspace that calls destroy_session() before destroying the
connections can trigger the failure. This patch prevents the issue by
refusing to destroy the session if there are outstanding connections.
------------[ cut here ]------------
kernel BUG at mm/slub.c:306!
invalid opcode: 0000 [#1] SMP PTI
CPU: 1 PID: 1224 Comm: iscsid Not tainted 5.4.0-rc2.iscsi+ #7
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
RIP: 0010:__slab_free+0x181/0x350
[...]
[ 1209.686056] RSP: 0018:ffffa93d4074fae0 EFLAGS: 00010246
[ 1209.686694] RAX: ffff934efa5ad800 RBX: 000000008010000a RCX: ffff934efa5ad800
[ 1209.687651] RDX: ffff934efa5ad800 RSI: ffffeb4041e96b00 RDI: ffff934efd402c40
[ 1209.688582] RBP: ffffa93d4074fb80 R08: 0000000000000001 R09: ffffffffbb5dfa26
[ 1209.689425] R10: ffff934efa5ad800 R11: 0000000000000001 R12: ffffeb4041e96b00
[ 1209.690285] R13: ffff934efa5ad800 R14: ffff934efd402c40 R15: 0000000000000000
[ 1209.691213] FS: 00007f7945dfb540(0000) GS:ffff934efda80000(0000) knlGS:0000000000000000
[ 1209.692316] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1209.693013] CR2: 000055877fd3da80 CR3: 0000000077384000 CR4: 00000000000006e0
[ 1209.693897] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1209.694773] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 1209.695631] Call Trace:
[ 1209.695957] ? __wake_up_common_lock+0x8a/0xc0
[ 1209.696712] iscsi_pool_free+0x26/0x40
[ 1209.697263] iscsi_session_teardown+0x2f/0xf0
[ 1209.698117] iscsi_sw_tcp_session_destroy+0x45/0x60
[ 1209.698831] iscsi_if_rx+0xd88/0x14e0
[ 1209.699370] netlink_unicast+0x16f/0x200
[ 1209.699932] netlink_sendmsg+0x21a/0x3e0
[ 1209.700446] sock_sendmsg+0x4f/0x60
[ 1209.700902] ___sys_sendmsg+0x2ae/0x320
[ 1209.701451] ? cp_new_stat+0x150/0x180
[ 1209.701922] __sys_sendmsg+0x59/0xa0
[ 1209.702357] do_syscall_64+0x52/0x160
[ 1209.702812] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 1209.703419] RIP: 0033:0x7f7946433914
[...]
[ 1209.706084] RSP: 002b:00007fffb99f2378 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
[ 1209.706994] RAX: ffffffffffffffda RBX: 000055bc869eac20 RCX: 00007f7946433914
[ 1209.708082] RDX: 0000000000000000 RSI: 00007fffb99f2390 RDI: 0000000000000005
[ 1209.709120] RBP: 00007fffb99f2390 R08: 000055bc84fe9320 R09: 00007fffb99f1f07
[ 1209.710110] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000038
[ 1209.711085] R13: 000055bc8502306e R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace a2d933ede7f730d8 ]---
Link: https://lore.kernel.org/r/20191226203148.2172200-1-krisman@collabora.com
Signed-off-by: Nick Black <nlb@google.com>
Co-developed-by: Salman Qazi <sqazi@google.com>
Signed-off-by: Salman Qazi <sqazi@google.com>
Co-developed-by: Junho Ryu <jayr@google.com>
Signed-off-by: Junho Ryu <jayr@google.com>
Co-developed-by: Khazhismel Kumykov <khazhy@google.com>
Signed-off-by: Khazhismel Kumykov <khazhy@google.com>
Co-developed-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-28 15:42:34 +01:00
..
2019-03-13 14:05:01 -07:00
2020-02-28 15:42:27 +01:00
2019-02-20 10:18:35 +01:00
2016-10-26 22:17:43 -04:00
2018-05-25 16:13:06 +02:00
2018-03-22 09:17:43 +01:00
2020-01-14 20:04:31 +01:00
2019-06-22 08:17:20 +02:00
2020-01-23 08:19:43 +01:00
2020-02-14 16:31:05 -05:00
2020-01-23 08:19:37 +01:00
2016-09-14 12:47:42 -04:00
2019-11-10 11:23:14 +01:00
2020-01-23 08:19:42 +01:00
2019-08-11 12:22:12 +02:00
2020-02-05 13:05:52 +00:00
2019-04-05 22:29:06 +02:00
2019-08-25 10:51:33 +02:00
2018-10-20 09:51:30 +02:00
2019-11-28 18:28:24 +01:00
2020-01-29 10:24:28 +01:00
2020-01-12 11:24:10 +01:00
2020-01-12 11:24:09 +01:00
2020-02-14 16:31:10 -05:00
2020-01-04 13:40:30 +01:00
2018-05-25 16:13:08 +02:00
2016-07-20 17:38:35 -06:00
2015-05-31 18:06:28 -07:00
2020-01-04 13:40:59 +01:00
2020-02-28 15:42:15 +01:00
2020-02-14 16:31:05 -05:00
2019-06-22 08:17:24 +02:00
2017-08-06 18:59:49 -07:00
2019-11-25 09:52:13 +01:00
2020-02-14 16:31:09 -05:00
2018-09-19 22:47:14 +02:00
2018-09-19 22:47:14 +02:00
2018-09-19 22:47:14 +02:00
2016-07-13 22:33:23 -04:00
2016-07-13 22:33:23 -04:00
2015-08-07 15:03:42 +02:00
2018-02-25 11:05:53 +01:00
2015-05-31 18:06:28 -07:00
2016-02-23 21:27:02 -05:00
2015-05-31 18:06:28 -07:00
2015-05-31 18:06:28 -07:00
2020-01-04 13:40:54 +01:00
2015-11-25 22:08:55 -05:00
2015-11-25 22:08:52 -05:00
2016-08-16 00:49:32 -04:00
2019-11-28 18:28:27 +01:00
2016-04-11 16:57:09 -04:00
2016-02-23 21:27:02 -05:00
2016-05-10 22:01:07 -04:00
2018-11-13 11:16:51 -08:00
2018-11-13 11:16:51 -08:00
2016-02-23 21:27:02 -05:00
2015-11-09 16:32:14 -08:00
2017-01-12 11:39:29 +01:00
2016-09-29 21:52:43 -04:00
2016-02-25 21:16:49 -05:00
2016-02-25 21:16:49 -05:00
2016-10-07 09:28:53 -07:00
2019-07-10 09:55:43 +02:00
2019-08-25 10:51:46 +02:00
2017-12-20 10:07:22 +01:00
2015-08-12 13:14:57 -07:00
2015-08-12 13:14:57 -07:00
2016-02-25 21:10:53 -05:00
2015-11-20 11:39:03 -05:00
2018-03-22 09:17:42 +01:00
2016-09-19 11:57:33 -04:00
2019-11-28 18:28:23 +01:00
2016-05-16 11:14:29 -04:00
2020-02-28 15:42:34 +01:00
2016-01-27 20:36:10 +08:00
2019-11-10 11:23:15 +01:00
2016-01-27 20:36:10 +08:00
2019-12-21 10:42:33 +01:00
2016-02-05 16:29:28 -06:00
2018-11-13 11:16:51 -08:00
2020-01-04 13:40:54 +01:00
2016-09-26 20:49:25 -04:00
2019-10-29 09:14:57 +01:00
2016-02-05 16:29:28 -06:00
2016-03-05 17:07:46 -05:00
2015-05-31 18:06:28 -07:00
2019-11-25 09:53:05 +01:00
2016-09-14 14:11:12 -04:00
2015-05-31 18:06:28 -07:00
2016-09-04 01:28:07 -04:00
2016-02-23 21:27:02 -05:00
2015-05-31 18:06:28 -07:00
2016-04-30 09:25:26 -07:00
2015-05-31 18:06:28 -07:00
2016-03-01 20:06:49 -05:00
2016-11-28 15:51:31 -05:00
2016-04-04 12:07:42 -04:00
2020-01-04 13:41:00 +01:00
2019-05-08 07:19:10 +02:00
2019-05-08 07:19:10 +02:00
2016-06-18 11:59:01 -07:00
2017-12-14 09:28:11 +01:00
2019-10-07 18:53:15 +02:00
2019-01-23 08:10:54 +01:00
2016-10-07 09:28:53 -07:00
2016-04-11 16:57:09 -04:00
2016-03-14 21:05:04 -04:00
2019-04-05 22:29:08 +02:00
2019-10-29 09:15:19 +01:00
2020-01-23 08:19:43 +01:00
2016-04-11 16:57:09 -04:00
2020-02-28 15:42:34 +01:00
2016-08-18 22:23:20 -04:00
2015-08-07 14:28:45 +02:00
2018-06-06 16:44:38 +02:00
2016-09-26 20:58:42 -04:00
2016-09-15 09:51:14 -04:00
2020-01-23 08:19:35 +01:00
2016-09-15 09:51:14 -04:00
2016-04-11 16:57:09 -04:00
2018-03-22 09:17:55 +01:00
2018-08-06 16:23:04 +02:00
2016-02-23 21:27:02 -05:00
2019-11-10 11:23:14 +01:00
2018-12-13 09:20:29 +01:00
2018-08-15 18:14:42 +02:00
2016-10-18 14:13:37 -07:00
2015-11-18 11:59:09 -05:00
2016-02-23 21:27:02 -05:00
2019-05-08 07:19:10 +02:00
2020-01-04 13:40:54 +01:00
2015-08-10 23:07:05 -04:00
2015-05-31 18:06:28 -07:00
2019-03-23 13:19:46 +01:00
2019-07-10 09:55:39 +02:00
2016-11-01 13:31:23 -04:00
2016-09-01 17:52:01 -07:00
2015-05-31 18:06:28 -07:00
2018-08-24 13:12:29 +02:00