Edward Lo
277439e7ca
fs/ntfs3: Enhance the attribute size check
...
commit 4f082a7531223a438c757bb20e304f4c941c67a8 upstream.
This combines the overflow and boundary check so that all attribute size
will be properly examined while enumerating them.
[ 169.181521] BUG: KASAN: slab-out-of-bounds in run_unpack+0x2e3/0x570
[ 169.183161] Read of size 1 at addr ffff8880094b6240 by task mount/247
[ 169.184046]
[ 169.184925] CPU: 0 PID: 247 Comm: mount Not tainted 6.0.0-rc7+ #3
[ 169.185908] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
[ 169.187066] Call Trace:
[ 169.187492] <TASK>
[ 169.188049] dump_stack_lvl+0x49/0x63
[ 169.188495] print_report.cold+0xf5/0x689
[ 169.188964] ? run_unpack+0x2e3/0x570
[ 169.189331] kasan_report+0xa7/0x130
[ 169.189714] ? run_unpack+0x2e3/0x570
[ 169.190079] __asan_load1+0x51/0x60
[ 169.190634] run_unpack+0x2e3/0x570
[ 169.191290] ? run_pack+0x840/0x840
[ 169.191569] ? run_lookup_entry+0xb3/0x1f0
[ 169.192443] ? mi_enum_attr+0x20a/0x230
[ 169.192886] run_unpack_ex+0xad/0x3e0
[ 169.193276] ? run_unpack+0x570/0x570
[ 169.193557] ? ni_load_mi+0x80/0x80
[ 169.193889] ? debug_smp_processor_id+0x17/0x20
[ 169.194236] ? mi_init+0x4a/0x70
[ 169.194496] attr_load_runs_vcn+0x166/0x1c0
[ 169.194851] ? attr_data_write_resident+0x250/0x250
[ 169.195188] mi_read+0x133/0x2c0
[ 169.195481] ntfs_iget5+0x277/0x1780
[ 169.196017] ? call_rcu+0x1c7/0x330
[ 169.196392] ? ntfs_get_block_bmap+0x70/0x70
[ 169.196708] ? evict+0x223/0x280
[ 169.197014] ? __kmalloc+0x33/0x540
[ 169.197305] ? wnd_init+0x15b/0x1b0
[ 169.197599] ntfs_fill_super+0x1026/0x1ba0
[ 169.197994] ? put_ntfs+0x1d0/0x1d0
[ 169.198299] ? vsprintf+0x20/0x20
[ 169.198583] ? mutex_unlock+0x81/0xd0
[ 169.198930] ? set_blocksize+0x95/0x150
[ 169.199269] get_tree_bdev+0x232/0x370
[ 169.199750] ? put_ntfs+0x1d0/0x1d0
[ 169.200094] ntfs_fs_get_tree+0x15/0x20
[ 169.200431] vfs_get_tree+0x4c/0x130
[ 169.200714] path_mount+0x654/0xfe0
[ 169.201067] ? putname+0x80/0xa0
[ 169.201358] ? finish_automount+0x2e0/0x2e0
[ 169.201965] ? putname+0x80/0xa0
[ 169.202445] ? kmem_cache_free+0x1c4/0x440
[ 169.203075] ? putname+0x80/0xa0
[ 169.203414] do_mount+0xd6/0xf0
[ 169.203719] ? path_mount+0xfe0/0xfe0
[ 169.203977] ? __kasan_check_write+0x14/0x20
[ 169.204382] __x64_sys_mount+0xca/0x110
[ 169.204711] do_syscall_64+0x3b/0x90
[ 169.205059] entry_SYSCALL_64_after_hwframe+0x63/0xcd
[ 169.205571] RIP: 0033:0x7f67a80e948a
[ 169.206327] Code: 48 8b 0d 11 fa 2a 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 008
[ 169.208296] RSP: 002b:00007ffddf020f58 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
[ 169.209253] RAX: ffffffffffffffda RBX: 000055e2547a6060 RCX: 00007f67a80e948a
[ 169.209777] RDX: 000055e2547a6260 RSI: 000055e2547a62e0 RDI: 000055e2547aeaf0
[ 169.210342] RBP: 0000000000000000 R08: 000055e2547a6280 R09: 0000000000000020
[ 169.210843] R10: 00000000c0ed0000 R11: 0000000000000202 R12: 000055e2547aeaf0
[ 169.211307] R13: 000055e2547a6260 R14: 0000000000000000 R15: 00000000ffffffff
[ 169.211913] </TASK>
[ 169.212304]
[ 169.212680] Allocated by task 0:
[ 169.212963] (stack is not available)
[ 169.213200]
[ 169.213472] The buggy address belongs to the object at ffff8880094b5e00
[ 169.213472] which belongs to the cache UDP of size 1152
[ 169.214095] The buggy address is located 1088 bytes inside of
[ 169.214095] 1152-byte region [ffff8880094b5e00, ffff8880094b6280)
[ 169.214639]
[ 169.215004] The buggy address belongs to the physical page:
[ 169.215766] page:000000002e324c8c refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x94b4
[ 169.218412] head:000000002e324c8c order:2 compound_mapcount:0 compound_pincount:0
[ 169.219078] flags: 0xfffffc0010200(slab|head|node=0|zone=1|lastcpupid=0x1fffff)
[ 169.220272] raw: 000fffffc0010200 0000000000000000 dead000000000122 ffff888002409b40
[ 169.221006] raw: 0000000000000000 00000000800c000c 00000001ffffffff 0000000000000000
[ 169.222320] page dumped because: kasan: bad access detected
[ 169.222922]
[ 169.223119] Memory state around the buggy address:
[ 169.224056] ffff8880094b6100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[ 169.224908] ffff8880094b6180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[ 169.225677] >ffff8880094b6200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[ 169.226445] ^
[ 169.227055] ffff8880094b6280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[ 169.227638] ffff8880094b6300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
Signed-off-by: Edward Lo <edward.lo@ambergroup.io>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: "Doebel, Bjoern" <doebel@amazon.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-03-01 13:26:39 +01:00
..
2024-02-05 20:12:59 +00:00
2022-05-09 16:21:44 -04:00
2023-02-01 08:34:08 +01:00
2024-03-01 13:26:36 +01:00
2023-09-23 11:10:59 +02:00
2022-08-02 12:34:03 -04:00
2022-05-09 16:21:44 -04:00
2024-02-23 09:12:29 +01:00
2024-03-01 13:26:32 +01:00
2024-02-23 09:12:46 +01:00
2023-03-10 09:33:52 +01:00
2022-12-31 13:32:22 +01:00
2023-03-10 09:34:09 +01:00
2023-05-11 23:03:00 +09:00
2024-01-20 11:50:04 +01:00
2024-02-16 19:06:29 +01:00
2024-02-05 20:12:49 +00:00
2024-01-25 15:27:20 -08:00
2022-05-09 16:21:45 -04:00
2024-03-01 13:26:39 +01:00
2023-11-28 17:07:00 +00:00
2022-08-17 17:25:04 -04:00
2023-09-23 11:11:05 +02:00
2024-03-01 13:26:28 +01:00
2024-02-16 19:06:31 +01:00
2022-10-11 17:42:58 -06:00
2022-08-02 12:34:03 -04:00
2024-01-31 16:17:04 -08:00
2024-01-01 12:39:08 +00:00
2024-01-25 15:27:22 -08:00
2023-03-10 09:34:07 +01:00
2023-05-24 17:32:34 +01:00
2022-09-19 22:46:25 +02:00
2022-05-09 16:21:45 -04:00
2024-02-23 09:12:46 +01:00
2023-12-08 08:51:20 +01:00
2022-10-12 11:00:22 -07:00
2024-01-20 11:50:07 +01:00
2023-07-19 16:22:11 +02:00
2024-02-05 20:12:48 +00:00
2024-02-05 20:12:58 +00:00
2023-09-13 09:42:49 +02:00
2022-09-24 07:00:00 +02:00
2023-10-06 14:56:32 +02:00
2024-01-25 15:27:23 -08:00
2024-02-23 09:12:50 +01:00
2024-02-23 09:12:52 +01:00
2023-09-13 09:42:22 +02:00
2023-07-19 16:22:05 +02:00
2022-10-12 11:00:22 -07:00
2024-03-01 13:26:39 +01:00
2023-09-13 09:42:33 +02:00
2022-05-09 16:21:44 -04:00
2023-02-09 11:28:04 +01:00
2023-11-28 17:07:12 +00:00
2024-02-23 09:12:47 +01:00
2024-02-05 20:12:48 +00:00
2022-05-09 16:21:44 -04:00
2022-09-11 21:55:07 -07:00
2023-11-28 17:07:13 +00:00
2023-07-19 16:22:11 +02:00
2023-09-13 09:42:27 +02:00
2022-05-09 16:21:46 -04:00
2024-03-01 13:26:30 +01:00
2023-02-22 12:59:50 +01:00
2023-08-11 12:08:23 +02:00
2023-09-23 11:11:12 +02:00
2024-01-31 16:17:02 -08:00
2023-09-13 09:43:05 +02:00
2022-09-11 20:26:07 -07:00
2022-05-09 16:21:46 -04:00
2023-09-13 09:43:03 +02:00
2024-01-31 16:17:08 -08:00
2024-02-23 09:12:45 +01:00
2024-03-01 13:26:39 +01:00
2022-08-20 11:34:04 -04:00
2023-09-23 11:11:10 +02:00
2022-09-24 07:00:00 +02:00
2023-10-06 14:57:06 +02:00
2023-07-01 13:16:25 +02:00
2022-12-31 13:32:57 +01:00
2022-10-12 11:00:22 -07:00
2022-12-31 13:32:41 +01:00
2023-02-22 12:59:50 +01:00
2022-08-20 11:34:33 -04:00
2022-09-24 18:14:12 -07:00
2024-02-05 20:12:54 +00:00
2022-09-20 08:24:38 -06:00
2023-09-13 09:42:27 +02:00
2023-06-21 16:00:54 +02:00
2024-01-31 16:17:07 -08:00
2022-06-10 16:10:23 -04:00
2022-09-01 17:36:39 -04:00
2022-08-16 10:59:54 -04:00
2023-08-11 12:08:23 +02:00
2023-09-13 09:42:28 +02:00
2023-01-07 11:11:59 +01:00
2023-11-20 11:51:50 +01:00
2022-05-19 23:25:10 -04:00
2024-01-10 17:10:32 +01:00
2023-08-30 16:11:10 +02:00
2024-01-31 16:17:00 -08:00
2023-06-28 11:12:40 +02:00
2022-10-10 14:21:11 -07:00
2022-06-16 19:58:21 -07:00
2022-12-31 13:31:58 +01:00
2023-09-23 11:11:00 +02:00
2023-06-28 11:12:40 +02:00
2023-01-07 11:12:02 +01:00
2022-07-05 16:18:21 -04:00
2022-08-03 10:35:43 -07:00
2024-01-31 16:17:02 -08:00
2024-02-23 09:12:46 +01:00
2022-08-20 11:34:04 -04:00
2023-08-11 12:08:22 +02:00
2024-01-31 16:17:09 -08:00
2023-01-04 11:29:01 +01:00
2022-10-10 17:53:04 -07:00
2022-06-28 13:58:05 -04:00
2023-02-09 11:28:04 +01:00
2022-08-17 17:25:04 -04:00
2022-08-05 16:32:45 -07:00
2023-02-09 11:28:04 +01:00
2024-01-10 17:10:31 +01:00
2022-09-11 19:47:12 -05:00
2023-05-24 17:32:51 +01:00
2023-08-11 12:08:24 +02:00
2022-04-26 13:36:25 -07:00
2023-04-26 14:28:37 +02:00
2022-12-31 13:31:55 +01:00