Nick Black
54155ed419
scsi: iscsi: Don't destroy session if there are outstanding connections
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>
2020-01-15 22:48:34 -05:00
..
2019-12-09 10:36:44 -08:00
2019-12-19 22:08:55 -05:00
2020-01-03 09:42:52 +01:00
2019-11-19 21:37:34 -05:00
2019-10-24 21:22:32 -04:00
2019-12-09 10:36:44 -08:00
2019-09-30 23:59:53 -04:00
2019-11-19 22:31:18 -05:00
2019-11-19 21:37:34 -05:00
2019-12-19 22:42:44 -05:00
2019-12-27 17:28:41 -08:00
2019-12-02 13:37:02 -08:00
2019-11-07 06:43:18 -07:00
2019-05-30 11:26:32 -07:00
2019-12-02 13:37:02 -08:00
2019-09-21 10:50:15 -07:00
2019-11-06 00:04:02 -05:00
2020-01-03 09:42:52 +01:00
2019-09-21 10:50:15 -07:00
2019-12-19 22:08:54 -05:00
2020-01-03 09:42:52 +01:00
2019-07-29 21:12:35 -04:00
2019-12-21 13:42:42 -05:00
2020-01-10 01:23:47 -05:00
2019-12-08 12:23:42 -08:00
2020-01-10 00:14:46 -05:00
2020-01-03 09:42:52 +01:00
2019-11-12 22:21:34 -05:00
2020-01-03 09:42:52 +01:00
2019-10-24 21:22:32 -04:00
2019-10-24 21:22:32 -04:00
2020-01-02 21:53:31 -05:00
2019-12-19 22:08:55 -05:00
2019-12-09 10:36:44 -08:00
2019-01-29 00:40:54 -05:00
2019-12-19 22:08:54 -05:00
2020-01-15 22:23:13 -05:00
2019-02-25 21:37:25 -05:00
2019-03-02 11:39:54 -08:00
2019-10-23 17:23:44 +02:00
2018-10-17 21:58:51 -04:00
2019-05-24 17:36:45 +02:00
2018-08-30 07:27:22 -04:00
2019-01-08 07:58:37 -05:00
2019-05-21 10:50:45 +02:00
2019-10-18 15:01:54 +02:00
2019-05-21 10:50:45 +02:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:17:41 -07:00
2019-05-21 10:50:45 +02:00
2018-12-18 23:13:12 -05:00
2018-06-19 22:02:25 -04:00
2019-05-21 10:50:45 +02:00
2019-11-12 22:21:34 -05:00
2019-11-12 22:21:35 -05:00
2020-01-15 22:19:49 -05:00
2019-06-05 17:37:11 +02:00
2019-05-21 10:50:45 +02:00
2020-01-03 09:42:32 +01:00
2018-12-18 23:19:21 -05:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-12-19 22:08:51 -05:00
2019-12-19 22:08:51 -05:00
2019-07-30 12:18:24 -04:00
2019-06-18 19:46:18 -04:00
2019-07-30 12:17:28 -04:00
2019-06-18 19:46:22 -04:00
2018-09-25 20:45:53 -04:00
2019-05-21 10:50:45 +02:00
2019-01-08 21:58:35 -05:00
2019-01-08 21:58:35 -05:00
2019-01-08 21:57:42 -05:00
2019-05-30 11:25:18 -07:00
2019-01-08 21:58:35 -05:00
2019-05-21 10:50:45 +02:00
2019-11-01 20:12:50 -04:00
2019-07-11 15:14:01 -07:00
2019-11-07 06:43:18 -07:00
2019-06-18 19:46:18 -04:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:36:37 +02:00
2019-07-11 15:17:41 -07:00
2019-12-19 22:08:54 -05:00
2020-01-03 09:42:52 +01:00
2019-05-30 11:26:35 -07:00
2019-09-30 22:46:40 -04:00
2018-11-06 21:31:28 -05:00
2019-06-05 17:36:37 +02:00
2020-01-15 22:48:34 -05:00
2019-05-30 11:26:37 -07:00
2019-05-21 10:50:45 +02:00
2019-11-07 06:43:18 -07:00
2019-05-24 17:36:45 +02:00
2019-07-11 15:14:01 -07:00
2019-12-09 19:19:28 -05:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-11-12 22:21:34 -05:00
2019-07-17 22:39:27 +09:00
2019-09-23 23:09:42 -04:00
2018-06-19 22:02:25 -04:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2018-12-18 23:13:12 -05:00
2019-07-11 15:17:41 -07:00
2019-05-30 11:26:39 -07:00
2018-12-28 14:48:06 -08:00
2020-01-02 21:57:44 -05:00
2019-05-20 10:56:43 -04:00
2020-01-02 21:57:44 -05:00
2019-10-24 21:22:32 -04:00
2019-05-24 17:36:45 +02:00
2019-11-19 21:37:34 -05:00
2019-06-20 15:37:02 -04:00
2018-06-19 22:02:25 -04:00
2019-10-24 21:22:32 -04:00
2019-05-24 17:39:02 +02:00
2019-10-23 17:23:44 +02:00
2019-05-30 11:26:35 -07:00
2019-06-20 15:21:33 -04:00
2019-05-30 11:26:38 -07:00
2019-08-16 11:33:56 -07:00
2019-08-16 11:33:56 -07:00
2019-03-19 17:11:37 -04:00
2018-12-18 23:19:21 -05:00
2019-08-07 21:32:53 -04:00
2019-02-13 22:07:03 -05:00
2019-06-05 17:37:17 +02:00
2019-05-24 17:36:45 +02:00
2019-11-19 21:37:34 -05:00
2019-07-30 12:42:55 -04:00
2019-05-21 06:16:21 -04:00
2019-07-11 20:39:22 -04:00
2019-05-30 11:26:35 -07:00
2019-10-03 21:43:04 -04:00
2020-01-03 09:33:18 +01:00
2019-12-19 22:08:52 -05:00
2019-09-30 23:07:16 -04:00
2019-12-19 22:08:54 -05:00
2019-05-30 11:26:35 -07:00
2019-09-12 07:11:58 -06:00
2019-11-01 20:12:50 -04:00
2019-07-30 13:07:42 +02:00
2019-04-15 22:25:00 -04:00
2019-05-30 11:29:53 -07:00
2019-12-02 13:37:02 -08:00
2019-11-06 00:06:03 -05:00
2019-07-11 15:14:01 -07:00
2020-01-15 22:48:34 -05:00
2019-11-21 21:12:39 -05:00
2019-05-30 11:26:35 -07:00
2019-06-19 17:09:56 +02:00
2019-12-02 13:37:02 -08:00
2018-06-19 22:02:25 -04:00
2019-06-05 17:37:14 +02:00
2020-01-02 21:53:31 -05:00
2020-01-03 09:42:32 +01:00
2019-12-08 12:23:42 -08:00
2019-07-11 15:14:01 -07:00
2020-01-03 09:42:32 +01:00
2018-12-18 23:19:21 -05:00
2019-05-24 17:36:45 +02:00
2019-10-09 23:35:42 -04:00
2018-08-02 15:22:13 -06:00
2019-11-26 13:02:26 -07:00
2020-01-03 09:42:52 +01:00
2020-01-03 09:42:32 +01:00
2019-05-30 11:26:32 -07:00
2019-11-21 20:10:44 -05:00
2019-11-12 22:21:34 -05:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-09-10 22:10:17 -04:00
2019-12-19 22:42:44 -05:00
2019-08-07 21:35:59 -04:00
2019-05-24 17:39:02 +02:00
2019-07-11 15:14:01 -07:00
2018-11-15 14:27:08 -05:00
2018-12-18 23:13:12 -05:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-11-12 22:21:34 -05:00