Paulo Alcantara
3a42709fa9
smb: client: fix OOB in smb2_query_reparse_point()
...
Validate @ioctl_rsp->OutputOffset and @ioctl_rsp->OutputCount so that
their sum does not wrap to a number that is smaller than @reparse_buf
and we end up with a wild pointer as follows:
BUG: unable to handle page fault for address: ffff88809c5cd45f
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 4a01067 P4D 4a01067 PUD 0
Oops: 0000 [#1 ] PREEMPT SMP NOPTI
CPU: 2 PID: 1260 Comm: mount.cifs Not tainted 6.7.0-rc4 #2
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014
RIP: 0010:smb2_query_reparse_point+0x3e0/0x4c0 [cifs]
Code: ff ff e8 f3 51 fe ff 41 89 c6 58 5a 45 85 f6 0f 85 14 fe ff ff
49 8b 57 48 8b 42 60 44 8b 42 64 42 8d 0c 00 49 39 4f 50 72 40 <8b>
04 02 48 8b 9d f0 fe ff ff 49 8b 57 50 89 03 48 8b 9d e8 fe ff
RSP: 0018:ffffc90000347a90 EFLAGS: 00010212
RAX: 000000008000001f RBX: ffff88800ae11000 RCX: 00000000000000ec
RDX: ffff88801c5cd440 RSI: 0000000000000000 RDI: ffffffff82004aa4
RBP: ffffc90000347bb0 R08: 00000000800000cd R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000024 R12: ffff8880114d4100
R13: ffff8880114d4198 R14: 0000000000000000 R15: ffff8880114d4000
FS: 00007f02c07babc0(0000) GS:ffff88806ba00000(0000)
knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff88809c5cd45f CR3: 0000000011750000 CR4: 0000000000750ef0
PKRU: 55555554
Call Trace:
<TASK>
? __die+0x23/0x70
? page_fault_oops+0x181/0x480
? search_module_extables+0x19/0x60
? srso_alias_return_thunk+0x5/0xfbef5
? exc_page_fault+0x1b6/0x1c0
? asm_exc_page_fault+0x26/0x30
? _raw_spin_unlock_irqrestore+0x44/0x60
? smb2_query_reparse_point+0x3e0/0x4c0 [cifs]
cifs_get_fattr+0x16e/0xa50 [cifs]
? srso_alias_return_thunk+0x5/0xfbef5
? lock_acquire+0xbf/0x2b0
cifs_root_iget+0x163/0x5f0 [cifs]
cifs_smb3_do_mount+0x5bd/0x780 [cifs]
smb3_get_tree+0xd9/0x290 [cifs]
vfs_get_tree+0x2c/0x100
? capable+0x37/0x70
path_mount+0x2d7/0xb80
? srso_alias_return_thunk+0x5/0xfbef5
? _raw_spin_unlock_irqrestore+0x44/0x60
__x64_sys_mount+0x11a/0x150
do_syscall_64+0x47/0xf0
entry_SYSCALL_64_after_hwframe+0x6f/0x77
RIP: 0033:0x7f02c08d5b1e
Fixes: 2e4564b31b64 ("smb3: add support for stat of WSL reparse points for special file types")
Cc: stable@vger.kernel.org
Reported-by: Robert Morris <rtm@csail.mit.edu>
Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2023-12-11 12:30:39 -06:00
..
2023-11-04 09:20:04 -10:00
2023-10-18 13:26:18 +02:00
2023-11-07 12:11:26 -08:00
2023-11-24 14:52:24 +00:00
2023-11-20 14:56:36 +01:00
2023-11-28 22:58:23 -05:00
2023-11-07 12:11:26 -08:00
2023-10-18 13:26:19 +02:00
2023-11-28 11:16:04 -08:00
2023-08-29 14:25:26 -07:00
2023-11-10 09:52:56 -08:00
2023-10-18 13:26:19 +02:00
2023-10-18 13:26:19 +02:00
2023-10-30 09:47:13 -10:00
2023-11-02 16:15:30 -10:00
2023-12-04 07:43:16 +01:00
2023-10-18 13:26:20 +02:00
2023-10-12 15:21:00 -05:00
2023-11-18 14:54:07 +01:00
2023-11-07 12:11:26 -08:00
2023-11-07 12:11:26 -08:00
2023-11-17 19:55:46 +08:00
2023-11-03 22:24:11 +09:00
2023-10-28 16:16:19 +02:00
2023-11-22 10:17:10 +01:00
2023-11-07 12:11:26 -08:00
2023-11-07 12:11:26 -08:00
2023-11-07 12:11:26 -08:00
2023-11-07 12:11:26 -08:00
2023-01-30 12:51:54 +00:00
2023-11-07 12:11:26 -08:00
2023-11-07 11:54:17 -08:00
2023-10-30 09:47:13 -10:00
2023-10-30 09:47:13 -10:00
2023-10-18 14:08:22 +02:00
2023-10-18 14:08:22 +02:00
2023-11-07 12:11:26 -08:00
2023-11-02 19:38:47 -10:00
2023-10-18 14:08:22 +02:00
2023-11-02 19:38:47 -10:00
2023-11-07 12:11:26 -08:00
2023-11-07 12:11:26 -08:00
2023-11-03 15:15:47 -10:00
2023-10-16 12:44:04 -04:00
2023-10-18 14:08:23 +02:00
2023-09-18 12:03:46 -07:00
2023-11-08 13:39:16 -08:00
2023-04-13 13:13:52 -07:00
2023-11-18 11:23:32 -08:00
2023-12-06 16:12:50 -08:00
2023-08-31 12:07:34 -05:00
2023-11-07 12:11:26 -08:00
2023-11-07 12:11:26 -08:00
2023-11-07 12:11:26 -08:00
2023-11-02 20:53:31 -10:00
2023-10-18 14:08:25 +02:00
2023-10-18 14:08:25 +02:00
2023-10-30 09:47:13 -10:00
2023-11-24 09:45:40 -08:00
2023-12-06 16:12:45 -08:00
2023-10-30 19:26:39 -10:00
2023-10-18 14:08:26 +02:00
2023-10-18 14:08:26 +02:00
2023-11-02 19:38:47 -10:00
2023-10-18 14:08:26 +02:00
2023-11-02 19:38:47 -10:00
2023-10-30 09:47:13 -10:00
2023-12-11 12:30:39 -06:00
2023-12-06 16:12:45 -08:00
2023-10-05 13:42:11 +02:00
2023-10-18 14:08:28 +02:00
2023-11-22 18:37:33 -05:00
2023-11-05 08:28:32 -10:00
2023-11-02 08:19:51 -10:00
2023-11-07 12:11:26 -08:00
2023-04-13 13:13:54 -07:00
2023-10-18 14:08:29 +02:00
2023-08-20 10:33:43 -07:00
2023-11-25 08:57:09 -08:00
2023-10-18 14:08:29 +02:00
2023-09-20 14:22:01 +02:00
2023-10-18 14:43:23 -07:00
2023-10-18 13:26:15 +02:00
2023-10-18 13:26:15 +02:00
2023-10-30 19:28:19 -10:00
2023-10-03 19:48:44 -07:00
2023-10-30 19:28:19 -10:00
2023-11-02 20:53:31 -10:00
2023-11-02 20:53:31 -10:00
2023-06-26 09:50:21 -07:00
2023-05-17 09:16:59 +02:00
2023-10-04 10:32:20 -07:00
2023-11-02 20:53:31 -10:00
2023-10-18 14:43:23 -07:00
2023-08-18 10:12:11 -07:00
2023-07-11 11:41:34 +02:00
2023-10-18 14:43:23 -07:00
2023-10-04 10:32:20 -07:00
2023-10-18 14:43:23 -07:00
2023-10-24 17:57:45 +02:00
2023-11-02 20:53:31 -10:00
2023-10-25 22:17:04 +02:00
2023-10-12 18:53:36 +03:00
2022-12-01 10:46:54 -05:00
2023-08-21 13:46:25 -07:00
2023-10-30 09:14:19 -10:00
2023-09-22 14:09:06 +02:00
2023-10-19 11:02:47 +02:00
2023-11-20 15:05:18 +01:00
2023-10-19 11:03:15 +02:00
2023-08-28 11:04:18 -07:00
2023-12-06 16:12:49 -08:00
2023-08-23 14:17:43 -07:00
2023-08-19 12:12:12 +02:00
2023-11-20 15:34:22 +01:00
2023-11-02 20:53:31 -10:00
2023-10-22 17:08:07 -04:00
2023-10-04 10:32:25 -07:00
2023-11-03 23:28:33 +01:00
2023-10-25 16:47:10 -07:00
2023-10-30 09:14:19 -10:00
2023-11-02 20:53:31 -10:00
2023-10-18 13:26:15 +02:00
2023-10-19 11:03:15 +02:00
2023-11-02 20:53:31 -10:00
2023-05-19 04:30:22 +02:00
2023-05-19 04:30:22 +02:00
2023-07-13 10:28:04 +02:00
2023-05-24 08:42:16 -06:00
2023-08-15 08:32:45 +02:00
2023-08-06 15:08:35 +02:00
2023-05-24 11:03:59 +02:00
2022-11-25 13:01:55 -05:00
2023-08-29 14:25:26 -07:00
2023-10-18 13:26:15 +02:00
2023-11-18 14:54:07 +01:00
2023-05-17 15:20:17 +02:00
2023-11-07 11:46:31 -08:00
2023-05-23 21:43:26 -07:00
2023-11-02 20:53:31 -10:00
2023-02-20 11:53:11 -08:00
2023-10-09 16:24:16 +02:00