Paulo Alcantara
41f10081a9
cifs: fix NULL ptr dereference in refresh_mounts()
...
Either mount(2) or automount might not have server->origin_fullpath
set yet while refresh_cache_worker() is attempting to refresh DFS
referrals. Add missing NULL check and locking around it.
This fixes bellow crash:
[ 1070.276835] general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1 ] PREEMPT SMP KASAN NOPTI
[ 1070.277676] KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
[ 1070.278219] CPU: 1 PID: 8506 Comm: kworker/u8:1 Not tainted 5.18.0-rc3 #10
[ 1070.278701] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b-rebuilt.opensuse.org 04/01/2014
[ 1070.279495] Workqueue: cifs-dfscache refresh_cache_worker [cifs]
[ 1070.280044] RIP: 0010:strcasecmp+0x34/0x150
[ 1070.280359] Code: 00 00 00 fc ff df 41 54 55 48 89 fd 53 48 83 ec 10 eb 03 4c 89 fe 48 89 ef 48 83 c5 01 48 89 f8 48 89 fa 48 c1 e8 03 83 e2 07 <42> 0f b6 04 28 38 d0 7f 08 84 c0 0f 85 bc 00 00 00 0f b6 45 ff 44
[ 1070.281729] RSP: 0018:ffffc90008367958 EFLAGS: 00010246
[ 1070.282114] RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000
[ 1070.282691] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
[ 1070.283273] RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffff873eda27
[ 1070.283857] R10: ffffc900083679a0 R11: 0000000000000001 R12: ffff88812624c000
[ 1070.284436] R13: dffffc0000000000 R14: ffff88810e6e9a88 R15: ffff888119bb9000
[ 1070.284990] FS: 0000000000000000(0000) GS:ffff888151200000(0000) knlGS:0000000000000000
[ 1070.285625] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1070.286100] CR2: 0000561a4d922418 CR3: 000000010aecc000 CR4: 0000000000350ee0
[ 1070.286683] Call Trace:
[ 1070.286890] <TASK>
[ 1070.287070] refresh_cache_worker+0x895/0xd20 [cifs]
[ 1070.287475] ? __refresh_tcon.isra.0+0xfb0/0xfb0 [cifs]
[ 1070.287905] ? __lock_acquire+0xcd1/0x6960
[ 1070.288247] ? is_dynamic_key+0x1a0/0x1a0
[ 1070.288591] ? lockdep_hardirqs_on_prepare+0x410/0x410
[ 1070.289012] ? lock_downgrade+0x6f0/0x6f0
[ 1070.289318] process_one_work+0x7bd/0x12d0
[ 1070.289637] ? worker_thread+0x160/0xec0
[ 1070.289970] ? pwq_dec_nr_in_flight+0x230/0x230
[ 1070.290318] ? _raw_spin_lock_irq+0x5e/0x90
[ 1070.290619] worker_thread+0x5ac/0xec0
[ 1070.290891] ? process_one_work+0x12d0/0x12d0
[ 1070.291199] kthread+0x2a5/0x350
[ 1070.291430] ? kthread_complete_and_exit+0x20/0x20
[ 1070.291770] ret_from_fork+0x22/0x30
[ 1070.292050] </TASK>
[ 1070.292223] Modules linked in: bpfilter cifs cifs_arc4 cifs_md4
[ 1070.292765] ---[ end trace 0000000000000000 ]---
[ 1070.293108] RIP: 0010:strcasecmp+0x34/0x150
[ 1070.293471] Code: 00 00 00 fc ff df 41 54 55 48 89 fd 53 48 83 ec 10 eb 03 4c 89 fe 48 89 ef 48 83 c5 01 48 89 f8 48 89 fa 48 c1 e8 03 83 e2 07 <42> 0f b6 04 28 38 d0 7f 08 84 c0 0f 85 bc 00 00 00 0f b6 45 ff 44
[ 1070.297718] RSP: 0018:ffffc90008367958 EFLAGS: 00010246
[ 1070.298622] RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000
[ 1070.299428] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
[ 1070.300296] RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffff873eda27
[ 1070.301204] R10: ffffc900083679a0 R11: 0000000000000001 R12: ffff88812624c000
[ 1070.301932] R13: dffffc0000000000 R14: ffff88810e6e9a88 R15: ffff888119bb9000
[ 1070.302645] FS: 0000000000000000(0000) GS:ffff888151200000(0000) knlGS:0000000000000000
[ 1070.303462] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1070.304131] CR2: 0000561a4d922418 CR3: 000000010aecc000 CR4: 0000000000350ee0
[ 1070.305004] Kernel panic - not syncing: Fatal exception
[ 1070.305711] Kernel Offset: disabled
[ 1070.305971] ---[ end Kernel panic - not syncing: Fatal exception ]---
Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Cc: stable@vger.kernel.org
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2022-04-20 22:54:17 -05:00
..
2022-03-31 15:49:36 -07:00
2022-03-22 18:26:56 -07:00
2022-03-22 18:26:56 -07:00
2022-04-08 23:54:37 +01:00
2022-03-22 15:57:03 -07:00
2022-03-22 18:26:56 -07:00
2022-04-14 10:58:27 -07:00
2022-04-08 23:32:40 +01:00
2022-04-01 13:50:50 -07:00
2022-04-20 22:54:17 -05:00
2022-03-22 17:03:12 -07:00
2022-02-22 18:30:28 +01:00
2022-04-01 13:45:33 -04:00
2022-02-25 11:56:13 +01:00
2022-01-24 14:17:02 +01:00
2022-01-12 11:11:34 -08:00
2022-03-22 18:26:56 -07:00
2022-03-22 15:57:03 -07:00
2022-03-22 18:26:56 -07:00
2022-04-01 14:20:24 -07:00
2022-03-25 17:38:15 -07:00
2022-04-01 14:40:44 -04:00
2022-04-01 14:40:44 -04:00
2022-03-24 14:14:07 -07:00
2022-03-22 15:57:03 -07:00
2022-04-08 23:54:37 +01:00
2022-04-01 13:45:33 -04:00
2022-03-31 15:57:50 -07:00
2022-03-22 18:26:56 -07:00
2022-03-22 18:26:56 -07:00
2022-03-22 18:26:56 -07:00
2022-03-22 18:26:56 -07:00
2022-03-22 18:26:56 -07:00
2022-04-01 14:40:43 -04:00
2022-03-22 15:57:03 -07:00
2022-03-22 18:26:56 -07:00
2022-03-31 16:09:41 -07:00
2022-03-29 18:17:30 -07:00
2022-04-01 19:57:03 -07:00
2022-04-01 14:39:28 -07:00
2022-02-28 10:26:40 -05:00
2022-03-24 14:14:07 -07:00
2022-03-18 09:29:05 +00:00
2022-04-08 07:39:17 -10:00
2022-04-12 14:23:19 -10:00
2022-04-01 11:46:09 -07:00
2022-03-14 09:05:25 +01:00
2022-04-01 14:40:44 -04:00
2022-03-22 18:26:56 -07:00
2022-04-01 11:46:09 -07:00
2022-03-16 13:37:04 -04:00
2022-03-22 15:57:03 -07:00
2022-03-22 18:26:56 -07:00
2022-03-22 15:57:03 -07:00
2022-04-03 12:26:01 -07:00
2022-03-15 11:08:23 -07:00
2022-03-22 15:57:03 -07:00
2022-03-22 15:57:03 -07:00
2022-01-30 08:59:47 -08:00
2022-03-25 17:38:15 -07:00
2022-03-22 15:57:03 -07:00
2022-03-31 09:38:53 -05:00
2022-03-22 16:11:53 -07:00
2022-04-05 15:39:19 +02:00
2022-03-22 18:26:56 -07:00
2022-02-25 21:05:04 -05:00
2022-03-31 16:09:41 -07:00
2022-03-25 17:38:15 -07:00
2022-03-22 18:26:56 -07:00
2022-02-14 10:37:32 +09:00
2022-03-22 18:26:56 -07:00
2022-04-01 13:45:33 -04:00
2022-04-01 19:30:44 -07:00
2022-03-26 11:51:46 -07:00
2022-04-01 19:57:03 -07:00
2022-03-08 12:55:29 -06:00
2022-03-03 20:38:56 -08:00
2022-04-15 14:49:56 -07:00
2022-03-09 10:37:07 -06:00
2022-02-09 09:50:02 -08:00
2022-04-01 14:40:44 -04:00
2022-03-03 20:38:56 -08:00
2022-03-28 17:29:53 -07:00
2022-03-24 18:12:09 -07:00
2022-03-22 15:57:03 -07:00
2022-03-07 12:45:57 -07:00
2022-01-22 08:33:35 +02:00
2022-03-28 17:29:53 -07:00
2022-03-08 17:55:03 -07:00
2022-04-07 16:19:47 -04:00
2022-03-29 23:29:18 -07:00
2022-01-18 09:23:19 +02:00
2021-12-09 14:09:36 -05:00
2022-03-22 16:11:53 -07:00
2022-03-22 15:57:03 -07:00
2022-04-01 19:57:03 -07:00
2022-04-14 20:23:40 -06:00
2022-03-28 17:29:53 -07:00
2022-04-11 17:06:20 -06:00
2022-04-01 19:35:56 -07:00
2022-03-22 17:03:12 -07:00
2022-03-21 19:16:02 -07:00
2022-03-16 13:37:05 -04:00
2022-01-22 08:33:36 +02:00
2022-02-01 11:13:24 -08:00
2022-03-26 11:59:30 -07:00
2022-04-14 15:53:43 -07:00
2022-04-01 19:57:03 -07:00
2022-03-08 17:55:03 -07:00
2022-03-23 19:00:34 -07:00
2022-04-01 19:57:03 -07:00
2022-03-22 18:26:56 -07:00
2022-01-11 09:03:05 -08:00
2022-02-01 11:31:55 -05:00
2022-01-17 05:49:30 +02:00
2022-03-21 12:59:01 -04:00
2022-04-12 13:35:08 -10:00
2022-01-30 08:59:47 -08:00
2022-01-30 08:59:47 -08:00
2022-01-22 08:33:36 +02:00
2022-03-22 15:57:08 -07:00