Paulo Alcantara
fa2f9906a7
smb: client: fix double free of TCP_Server_Info::hostname
When shutting down the server in cifs_put_tcp_session(), cifsd thread
might be reconnecting to multiple DFS targets before it realizes it
should exit the loop, so @server->hostname can't be freed as long as
cifsd thread isn't done. Otherwise the following can happen:
RIP: 0010:__slab_free+0x223/0x3c0
Code: 5e 41 5f c3 cc cc cc cc 4c 89 de 4c 89 cf 44 89 44 24 08 4c 89
1c 24 e8 fb cf 8e 00 44 8b 44 24 08 4c 8b 1c 24 e9 5f fe ff ff <0f>
0b 41 f7 45 08 00 0d 21 00 0f 85 2d ff ff ff e9 1f ff ff ff 80
RSP: 0018:ffffb26180dbfd08 EFLAGS: 00010246
RAX: ffff8ea34728e510 RBX: ffff8ea34728e500 RCX: 0000000000800068
RDX: 0000000000800068 RSI: 0000000000000000 RDI: ffff8ea340042400
RBP: ffffe112041ca380 R08: 0000000000000001 R09: 0000000000000000
R10: 6170732e31303000 R11: 70726f632e786563 R12: ffff8ea34728e500
R13: ffff8ea340042400 R14: ffff8ea34728e500 R15: 0000000000800068
FS: 0000000000000000(0000) GS:ffff8ea66fd80000(0000)
000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffc25376080 CR3: 000000012a2ba001 CR4:
PKRU: 55555554
Call Trace:
<TASK>
? show_trace_log_lvl+0x1c4/0x2df
? show_trace_log_lvl+0x1c4/0x2df
? __reconnect_target_unlocked+0x3e/0x160 [cifs]
? __die_body.cold+0x8/0xd
? die+0x2b/0x50
? do_trap+0xce/0x120
? __slab_free+0x223/0x3c0
? do_error_trap+0x65/0x80
? __slab_free+0x223/0x3c0
? exc_invalid_op+0x4e/0x70
? __slab_free+0x223/0x3c0
? asm_exc_invalid_op+0x16/0x20
? __slab_free+0x223/0x3c0
? extract_hostname+0x5c/0xa0 [cifs]
? extract_hostname+0x5c/0xa0 [cifs]
? __kmalloc+0x4b/0x140
__reconnect_target_unlocked+0x3e/0x160 [cifs]
reconnect_dfs_server+0x145/0x430 [cifs]
cifs_handle_standard+0x1ad/0x1d0 [cifs]
cifs_demultiplex_thread+0x592/0x730 [cifs]
? __pfx_cifs_demultiplex_thread+0x10/0x10 [cifs]
kthread+0xdd/0x100
? __pfx_kthread+0x10/0x10
ret_from_fork+0x29/0x50
</TASK>
Fixes: 7be3248f31 ("cifs: To match file servers, make sure the server hostname matches")
Reported-by: Jay Shin <jaeshin@redhat.com>
Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-01-15 16:56:06 -06:00
..
2024-12-20 22:07:57 +01:00
2024-10-08 14:41:53 +02:00
2024-10-08 14:41:53 +02:00
2025-01-09 17:21:41 +01:00
2024-10-28 13:16:56 +01:00
2024-11-25 16:09:48 -08:00
2024-09-18 11:44:43 +02:00
2024-08-07 11:33:21 +02:00
2025-01-09 10:16:45 -08:00
2024-12-20 22:07:56 +01:00
2024-12-16 23:25:44 +01:00
2024-08-19 13:45:03 +02:00
2024-11-14 07:45:20 +01:00
2024-07-15 11:14:59 -07:00
2024-11-19 10:43:44 -08:00
2025-01-10 09:41:53 +01:00
2024-11-18 10:05:57 -06:00
2024-11-26 13:39:02 -08:00
2024-12-15 15:33:41 -08:00
2024-10-15 15:58:36 +02:00
2024-12-16 21:02:07 +08:00
2024-12-31 17:51:21 +09:00
2024-11-15 11:34:57 +01:00
2024-09-16 09:14:02 +02:00
2024-11-18 16:32:58 -08:00
2024-11-26 12:50:58 -08:00
2024-10-17 00:28:06 -07:00
2024-11-06 10:42:06 +01:00
2025-01-07 15:43:07 +01:00
2024-11-26 12:34:50 -08:00
2024-12-02 15:32:19 +01:00
2024-11-18 09:35:30 -08:00
2024-11-15 20:55:32 +01:00
2024-10-08 14:41:53 +02:00
2024-12-18 19:04:42 -08:00
2025-01-09 16:09:20 +01:00
2024-11-06 20:24:41 +01:00
2024-12-04 12:00:05 +01:00
2024-12-05 12:31:40 +01:00
2024-11-21 09:59:59 -08:00
2024-11-26 12:59:30 -08:00
2024-08-07 11:33:36 +02:00
2025-01-09 17:20:04 +01:00
2025-01-06 10:26:39 -08:00
2024-11-18 20:23:12 -05:00
2024-12-23 12:16:15 -08:00
2024-12-18 19:04:45 -08:00
2024-10-02 17:23:23 -04:00
2024-12-19 15:18:27 +01:00
2024-11-01 11:19:53 +03:00
2024-12-30 17:59:09 -08:00
2024-08-07 11:33:21 +02:00
2024-06-20 09:46:01 +02:00
2024-10-02 17:23:23 -04:00
2025-01-06 15:43:55 +01:00
2024-12-30 17:59:08 -08:00
2024-12-01 15:12:43 -08:00
2024-12-03 10:40:36 +01:00
2024-11-26 22:54:00 +01:00
2024-08-21 22:32:58 +02:00
2025-01-15 16:56:06 -06:00
2024-10-30 20:14:12 -07:00
2024-11-05 14:00:28 +01:00
2024-08-07 11:33:36 +02:00
2024-07-22 18:25:47 -07:00
2024-11-01 08:38:14 -04:00
2024-11-30 10:32:47 -08:00
2024-11-26 22:54:24 +01:00
2024-11-12 19:02:12 -05:00
2024-12-11 14:11:23 -08:00
2024-08-07 11:32:02 +02:00
2024-08-20 14:03:18 -04:00
2025-01-10 10:12:48 +01:00
2024-10-02 12:02:15 -07:00
2024-11-19 16:35:06 -08:00
2024-10-10 10:20:51 +02:00
2024-11-26 18:13:29 +01:00
2024-11-27 12:51:30 +01:00
2024-11-27 12:51:30 +01:00
2024-10-02 17:23:23 -04:00
2024-11-27 12:51:30 +01:00
2024-08-07 11:26:54 -07:00
2024-11-23 09:58:07 -08:00
2024-10-22 11:16:57 +02:00
2024-10-17 18:38:49 +01:00
2024-10-22 11:16:58 +02:00
2024-10-07 13:51:47 +02:00
2024-11-23 09:58:07 -08:00
2024-08-19 13:45:02 +02:00
2024-07-24 20:59:29 +02:00
2024-11-03 01:28:06 -05:00
2024-11-21 08:28:08 -08:00
2024-11-27 12:51:30 +01:00
2024-11-25 15:16:49 +01:00
2024-11-26 13:26:15 -08:00
2024-10-30 09:58:02 +01:00
2024-12-17 13:38:46 +01:00
2024-11-18 10:45:06 -08:00
2024-11-13 14:08:34 +01:00
2024-11-03 01:28:06 -05:00
2024-11-23 09:58:07 -08:00
2024-11-18 14:54:10 -08:00
2024-11-03 01:28:06 -05:00
2024-10-21 16:29:38 +02:00
2024-06-19 13:13:55 -07:00
2024-11-03 01:28:06 -05:00
2024-11-18 14:54:10 -08:00
2024-11-03 01:28:06 -05:00
2024-10-21 16:29:38 +02:00
2024-09-24 15:29:42 -07:00
2025-01-09 16:58:50 +01:00
2024-10-28 13:26:54 +01:00
2024-11-18 12:44:25 -08:00
2025-01-09 17:03:21 +01:00
2024-09-27 08:18:43 -07:00
2024-11-21 09:55:45 -08:00
2024-10-24 13:54:51 +02:00
2024-09-27 08:18:43 -07:00
2024-10-22 11:16:59 +02:00
2024-06-28 14:36:43 +02:00
2024-11-18 12:24:06 -08:00
2024-11-03 01:28:06 -05:00
2024-11-03 01:28:07 -05:00
2024-11-03 01:28:07 -05:00
2024-10-22 11:16:57 +02:00
2024-11-03 01:28:06 -05:00
2024-11-03 01:28:06 -05:00
2024-11-18 14:54:10 -08:00
2024-11-03 01:28:06 -05:00
2024-10-21 14:30:26 +02:00
2024-11-03 01:28:06 -05:00
2024-11-19 16:35:06 -08:00
2024-10-28 21:40:38 -07:00
2024-11-03 01:28:06 -05:00
2024-11-06 13:00:01 -05:00