Paulo Alcantara
be7a6a7766
smb: client: fix oops due to unset link speed
It isn't guaranteed that NETWORK_INTERFACE_INFO::LinkSpeed will always
be set by the server, so the client must handle any values and then
prevent oopses like below from happening:
Oops: divide error: 0000 [#1] PREEMPT SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 1323 Comm: cat Not tainted 6.13.0-rc7 #2
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-3.fc41
04/01/2014
RIP: 0010:cifs_debug_data_proc_show+0xa45/0x1460 [cifs] Code: 00 00 48
89 df e8 3b cd 1b c1 41 f6 44 24 2c 04 0f 84 50 01 00 00 48 89 ef e8
e7 d0 1b c1 49 8b 44 24 18 31 d2 49 8d 7c 24 28 <48> f7 74 24 18 48 89
c3 e8 6e cf 1b c1 41 8b 6c 24 28 49 8d 7c 24
RSP: 0018:ffffc90001817be0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88811230022c RCX: ffffffffc041bd99
RDX: 0000000000000000 RSI: 0000000000000567 RDI: ffff888112300228
RBP: ffff888112300218 R08: fffff52000302f5f R09: ffffed1022fa58ac
R10: ffff888117d2c566 R11: 00000000fffffffe R12: ffff888112300200
R13: 000000012a15343f R14: 0000000000000001 R15: ffff888113f2db58
FS: 00007fe27119e740(0000) GS:ffff888148600000(0000)
knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fe2633c5000 CR3: 0000000124da0000 CR4: 0000000000750ef0
PKRU: 55555554
Call Trace:
<TASK>
? __die_body.cold+0x19/0x27
? die+0x2e/0x50
? do_trap+0x159/0x1b0
? cifs_debug_data_proc_show+0xa45/0x1460 [cifs]
? do_error_trap+0x90/0x130
? cifs_debug_data_proc_show+0xa45/0x1460 [cifs]
? exc_divide_error+0x39/0x50
? cifs_debug_data_proc_show+0xa45/0x1460 [cifs]
? asm_exc_divide_error+0x1a/0x20
? cifs_debug_data_proc_show+0xa39/0x1460 [cifs]
? cifs_debug_data_proc_show+0xa45/0x1460 [cifs]
? seq_read_iter+0x42e/0x790
seq_read_iter+0x19a/0x790
proc_reg_read_iter+0xbe/0x110
? __pfx_proc_reg_read_iter+0x10/0x10
vfs_read+0x469/0x570
? do_user_addr_fault+0x398/0x760
? __pfx_vfs_read+0x10/0x10
? find_held_lock+0x8a/0xa0
? __pfx_lock_release+0x10/0x10
ksys_read+0xd3/0x170
? __pfx_ksys_read+0x10/0x10
? __rcu_read_unlock+0x50/0x270
? mark_held_locks+0x1a/0x90
do_syscall_64+0xbb/0x1d0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fe271288911
Code: 00 48 8b 15 01 25 10 00 f7 d8 64 89 02 b8 ff ff ff ff eb bd e8
20 ad 01 00 f3 0f 1e fa 80 3d b5 a7 10 00 00 74 13 31 c0 0f 05 <48> 3d
00 f0 ff ff 77 4f c3 66 0f 1f 44 00 00 55 48 89 e5 48 83 ec
RSP: 002b:00007ffe87c079d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000000000040000 RCX: 00007fe271288911
RDX: 0000000000040000 RSI: 00007fe2633c6000 RDI: 0000000000000003
RBP: 00007ffe87c07a00 R08: 0000000000000000 R09: 00007fe2713e6380
R10: 0000000000000022 R11: 0000000000000246 R12: 0000000000040000
R13: 00007fe2633c6000 R14: 0000000000000003 R15: 0000000000000000
</TASK>
Fix this by setting cifs_server_iface::speed to a sane value (1Gbps)
by default when link speed is unset.
Cc: Shyam Prasad N <nspmangalore@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Fixes: a6d8fb54a5 ("cifs: distribute channels across interfaces based on speed")
Reported-by: Frank Sorenson <sorenson@redhat.com>
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-19 19:34:00 -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-16 08:54:33 -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-05-04 19:02:39 +02: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
2025-01-15 21:15:44 -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
2025-01-12 19:03:38 -08:00
2024-12-01 15:12:43 -08:00
2024-05-28 11:52:53 +02:00
2024-12-03 10:40:36 +01:00
2024-11-26 22:54:00 +01:00
2024-04-25 20:56:25 -07:00
2024-08-21 22:32:58 +02:00
2025-01-19 19:34:00 -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-04-26 10:33:05 +02: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-05-28 12:06:51 +02: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