ci starts bisection 2022-08-25 06:51:47.039895004 +0000 UTC m=+63306.188789262 bisecting cause commit starting from c40e8341e3b3bb27e3a65b06b5b454626234c4f0 building syzkaller on 514514f61b1dec32386fca74dfe3875a277d1791 testing commit c40e8341e3b3bb27e3a65b06b5b454626234c4f0 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 8358a88b79282c1a31d8689d719c575523adcaeb620f081d504fe02a828f5ad2 run #0: crashed: KASAN: use-after-free Read in ntfs_attr_find run #1: crashed: KASAN: use-after-free Read in ntfs_attr_find run #2: crashed: KASAN: use-after-free Read in ntfs_attr_find run #3: crashed: KASAN: use-after-free Read in ntfs_attr_find run #4: crashed: KASAN: use-after-free Read in ntfs_attr_find run #5: crashed: KASAN: use-after-free Read in ntfs_attr_find run #6: crashed: KASAN: use-after-free Read in ntfs_attr_find run #7: crashed: KASAN: use-after-free Read in ntfs_attr_find run #8: crashed: KASAN: use-after-free Read in ntfs_attr_find run #9: crashed: KASAN: use-after-free Read in ntfs_attr_find run #10: crashed: KASAN: use-after-free Read in ntfs_attr_find run #11: crashed: KASAN: use-after-free Read in ntfs_attr_find run #12: crashed: KASAN: use-after-free Read in ntfs_attr_find run #13: crashed: KASAN: use-after-free Read in ntfs_attr_find run #14: crashed: KASAN: use-after-free Read in ntfs_attr_find run #15: crashed: KASAN: use-after-free Read in ntfs_attr_find run #16: crashed: KASAN: use-after-free Read in ntfs_attr_find run #17: crashed: KASAN: use-after-free Read in ntfs_attr_find run #18: crashed: KASAN: slab-out-of-bounds Read in ntfs_attr_find run #19: crashed: KASAN: slab-out-of-bounds Read in ntfs_attr_find testing release v5.19 testing commit 3d7cb6b04c3f3115719235cc6866b10326de34cd compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 2f8730c79e2bf984a34bdff96c3d65c83205ad620df8274ef5248c8556e4b18f all runs: crashed: KASAN: use-after-free Read in ntfs_attr_find testing release v5.18 testing commit 4b0986a3613c92f4ec1bdc7f60ec66fea135991f compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 32a9aeffeb76f1f48ecef9ddb6b82ee9084d97f6a1eb5e591da686d92676ebaa all runs: OK # git bisect start 3d7cb6b04c3f3115719235cc6866b10326de34cd 4b0986a3613c92f4ec1bdc7f60ec66fea135991f Bisecting: 8493 revisions left to test after this (roughly 13 steps) [c011dd537ffe47462051930413fed07dbdc80313] Merge tag 'arm-soc-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc testing commit c011dd537ffe47462051930413fed07dbdc80313 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: fe8d154322a907f48620aa073bb7cc1898a5cc64d5a0906fc204fd1fd7270413 all runs: OK # git bisect good c011dd537ffe47462051930413fed07dbdc80313 Bisecting: 4244 revisions left to test after this (roughly 12 steps) [5d4af9c1f04ab0411ba5818baad9a68e87f33099] Merge branch 'mv88e6xxx-fixes-for-reading-serdes-state' testing commit 5d4af9c1f04ab0411ba5818baad9a68e87f33099 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 85056e0e52a6cd85124d7d58c06fa3ef5a06e43596a18c94141dd8c187b14d24 all runs: OK # git bisect good 5d4af9c1f04ab0411ba5818baad9a68e87f33099 Bisecting: 2122 revisions left to test after this (roughly 11 steps) [7a68065eb9cd194cf03f135c9211eeb2d5c4c0a0] Merge tag 'gpio-fixes-for-v5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux testing commit 7a68065eb9cd194cf03f135c9211eeb2d5c4c0a0 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 4a96ffc8be51d3bd36a352b489e0780891b16314224d86e41b246e20100435dd all runs: OK # git bisect good 7a68065eb9cd194cf03f135c9211eeb2d5c4c0a0 Bisecting: 1057 revisions left to test after this (roughly 10 steps) [c1084b6c5620a743f86947caca66d90f24060f56] Merge tag 'soc-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc testing commit c1084b6c5620a743f86947caca66d90f24060f56 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 821f10fa8dd910176e3d80c27225abe9f0d612584bd7a2e01af7dc42f1e3d394 all runs: OK # git bisect good c1084b6c5620a743f86947caca66d90f24060f56 Bisecting: 528 revisions left to test after this (roughly 9 steps) [6305d821e3b9b5379d348528e5b5faf316383bc2] igmp: Fix a data-race around sysctl_igmp_max_memberships. testing commit 6305d821e3b9b5379d348528e5b5faf316383bc2 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: dabdb7eb1aeaae4b3b7625455588da079350b1b4616e03fbe1fd243f735f9447 run #0: boot failed: failed to delete instance: googleapi: Error 503: Authentication backend unavailable., backendError run #1: boot failed: failed to delete instance: googleapi: Error 503: Authentication backend unavailable., backendError run #2: boot failed: failed to get delete image operation operation-1661417040043-5e70ccc7edf8a-95178d28-c3702ecd: googleapi: Error 503: Authentication backend unavailable., backendError run #3: boot failed: failed to get create image operation operation-1661417050044-5e70ccd1778a9-320cbf3a-e4aaa487: googleapi: Error 503: Authentication backend unavailable., backendError run #4: boot failed: failed to get create image operation operation-1661417045043-5e70ccccb29a5-3dc6adf6-d7f93fdd: googleapi: Error 503: Authentication backend unavailable., backendError run #5: boot failed: failed to get create image operation operation-1661417053044-5e70ccd4540fd-aa82eda8-486b4e32: googleapi: Error 503: Authentication backend unavailable., backendError run #6: boot failed: failed to get create image operation operation-1661417046043-5e70cccda6b98-4eecb2b6-f7c3eb5a: googleapi: Error 503: Authentication backend unavailable., backendError run #7: boot failed: failed to get create image operation operation-1661417049049-5e70ccd0847ec-ab6bc258-74207bd4: googleapi: Error 503: Authentication backend unavailable., backendError run #8: boot failed: failed to get create image operation operation-1661417047043-5e70ccce9af6c-43e2a200-8a5801f8: googleapi: Error 503: Authentication backend unavailable., backendError run #9: boot failed: failed to get create image operation operation-1661417044043-5e70cccbbe80f-e1880818-e01cdcc1: googleapi: Error 503: Authentication backend unavailable., backendError # git bisect skip 6305d821e3b9b5379d348528e5b5faf316383bc2 Bisecting: 528 revisions left to test after this (roughly 9 steps) [45533a534a45cb12c20c81615d17306176cb1c57] net: lan966x: Fix taking rtnl_lock while holding spin_lock testing commit 45533a534a45cb12c20c81615d17306176cb1c57 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 10b393a659080a51caf40114ebc90901fcfad43b017d504c26a67343cbb647df failed: failed to create VM pool: failed to init gce: error getting instance info: googleapi: Error 503: Authentication backend unavailable., backendError # git bisect skip 45533a534a45cb12c20c81615d17306176cb1c57 Bisecting: 528 revisions left to test after this (roughly 9 steps) [829be057dbc1e71383b8d7de8edb31dcf07b4aa0] wireguard: selftests: set fake real time in init testing commit 829be057dbc1e71383b8d7de8edb31dcf07b4aa0 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: c752810c3419beeb2dd6b76bbb83e1a9bddaed1a87d29bf63caf1868e2e84ad9 run #0: boot failed: failed to delete instance: googleapi: Error 503: Authentication backend unavailable., backendError run #1: boot failed: failed to get delete image operation operation-1661418210260-5e70d123ef4a3-fb7c3116-98c42366: googleapi: Error 503: Authentication backend unavailable., backendError run #2: boot failed: failed to get delete image operation operation-1661418212259-5e70d125d7671-0f58b0ce-99b6fb79: googleapi: Error 503: Authentication backend unavailable., backendError run #3: boot failed: failed to get delete image operation operation-1661418214259-5e70d127bfa30-1a74163c-da72cd1f: googleapi: Error 503: Authentication backend unavailable., backendError run #4: boot failed: failed to create instance: googleapi: Error 503: Authentication backend unavailable., backendError run #5: boot failed: failed to get delete image operation operation-1661418218259-5e70d12b905c7-8b28114f-f210817e: googleapi: Error 503: Authentication backend unavailable., backendError run #6: boot failed: failed to get create image operation operation-1661418219260-5e70d12c84af2-43f92c2a-48256f8b: googleapi: Error 503: Authentication backend unavailable., backendError run #7: boot failed: failed to get delete image operation operation-1661418217260-5e70d12a9c3f3-37594524-4f541329: googleapi: Error 503: Authentication backend unavailable., backendError run #8: boot failed: error getting instance ci-upstream-kasan-gce-root-bisect-job-bisect-job-7 details after creation: googleapi: Error 503: The service is currently unavailable., backendError run #9: boot failed: failed to get delete image operation operation-1661418213259-5e70d126cb933-2c8b34f8-6b38a23c: googleapi: Error 503: Authentication backend unavailable., backendError # git bisect skip 829be057dbc1e71383b8d7de8edb31dcf07b4aa0 Bisecting: 528 revisions left to test after this (roughly 9 steps) [e465d507c76ce2552e1e08513f1d1ca8c4175e9c] docs: net: dsa: remove port_vlan_dump testing commit e465d507c76ce2552e1e08513f1d1ca8c4175e9c compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 02f2af8cb02721aec181385766bd4a4f4be2cb387c1971ed243a609e974e91d0 run #0: boot failed: failed to delete instance: googleapi: Error 503: Authentication backend unavailable., backendError run #1: boot failed: failed to get create image operation operation-1661418894504-5e70d3b07b057-e0befca3-a08ceef3: googleapi: Error 503: Authentication backend unavailable., backendError run #2: boot failed: failed to get create image operation operation-1661418892504-5e70d3ae92c98-f2920b06-cf3a32e7: googleapi: Error 503: Authentication backend unavailable., backendError run #3: boot failed: failed to get create image operation operation-1661418893503-5e70d3af86cdc-15cd178d-6903e5d5: googleapi: Error 503: Authentication backend unavailable., backendError run #4: boot failed: failed to get delete image operation operation-1661418884504-5e70d3a6f19eb-2833d94b-e95b45fd: googleapi: Error 503: Authentication backend unavailable., backendError run #5: boot failed: failed to create instance: googleapi: Error 503: Authentication backend unavailable., backendError run #6: boot failed: failed to get delete image operation operation-1661418887503-5e70d3a9cdfe5-aa79651e-b6240a81: googleapi: Error 503: Authentication backend unavailable., backendError run #7: boot failed: failed to get create image operation operation-1661418891503-5e70d3ad9e952-3099c576-5a8cca0f: googleapi: Error 503: The service is currently unavailable., backendError run #8: OK run #9: OK # git bisect skip e465d507c76ce2552e1e08513f1d1ca8c4175e9c Bisecting: 528 revisions left to test after this (roughly 9 steps) [fe5235aef8558573c1d225199be3aaa7bcd22943] Merge tag 'mlx5-fixes-2022-07-06' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux testing commit fe5235aef8558573c1d225199be3aaa7bcd22943 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: d6a97d074c468aeebd397a02f78b1d5db4efe4a5e0fe87b5dc615849e293606a all runs: OK # git bisect good fe5235aef8558573c1d225199be3aaa7bcd22943 Bisecting: 456 revisions left to test after this (roughly 9 steps) [3666f666e99600518ab20982af04a078bbdad277] tcp: Fix data-races around sysctl knobs related to SYN option. testing commit 3666f666e99600518ab20982af04a078bbdad277 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: d2f183d4cafda5d339fabb46a8da8e65116f56d6ddb2e6c6188a4c771ca38dad all runs: OK # git bisect good 3666f666e99600518ab20982af04a078bbdad277 Bisecting: 227 revisions left to test after this (roughly 8 steps) [4d8f24eeedc58d5f87b650ddda73c16e8ba56559] Revert "tcp: change pingpong threshold to 3" testing commit 4d8f24eeedc58d5f87b650ddda73c16e8ba56559 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 73163231fe47133ce6ed3c80534abd518ee205af873aa1a05f1dca8f4b481f20 all runs: OK # git bisect good 4d8f24eeedc58d5f87b650ddda73c16e8ba56559 Bisecting: 119 revisions left to test after this (roughly 7 steps) [e64ab2dbd882933b65cd82ff6235d705ad65dbb6] watch_queue: Fix missing locking in add_watch_to_object() testing commit e64ab2dbd882933b65cd82ff6235d705ad65dbb6 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: a0bcf06b0a547446d6c455fe5f6aac3501c4e78e3eea351372dd959176de5f1d run #0: crashed: KASAN: use-after-free Read in ntfs_attr_find run #1: crashed: KASAN: use-after-free Read in ntfs_attr_find run #2: crashed: KASAN: use-after-free Read in ntfs_attr_find run #3: crashed: KASAN: use-after-free Read in ntfs_attr_find run #4: crashed: KASAN: use-after-free Read in ntfs_attr_find run #5: crashed: KASAN: use-after-free Read in ntfs_attr_find run #6: crashed: KASAN: use-after-free Read in ntfs_attr_find run #7: crashed: KASAN: slab-out-of-bounds Read in ntfs_attr_find run #8: crashed: KASAN: use-after-free Read in ntfs_attr_find run #9: crashed: KASAN: use-after-free Read in ntfs_attr_find # git bisect bad e64ab2dbd882933b65cd82ff6235d705ad65dbb6 Bisecting: 55 revisions left to test after this (roughly 6 steps) [ae21fbac18b980ecfd895ff32833a2543c157ee2] Merge tag 'acpi-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm testing commit ae21fbac18b980ecfd895ff32833a2543c157ee2 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 77e7c72879c59328cf456d149b9d417e2b93c4f9e1d253ba6a26a7c4636c55ad all runs: OK # git bisect good ae21fbac18b980ecfd895ff32833a2543c157ee2 Bisecting: 27 revisions left to test after this (roughly 5 steps) [e90886291c7cd89577bf11729b205cc0ed42fbec] certs: make system keyring depend on x509 parser testing commit e90886291c7cd89577bf11729b205cc0ed42fbec compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: b8375063ef1d3247646189c4d6909dde778d28db129878246da7c641f041ad5c all runs: OK # git bisect good e90886291c7cd89577bf11729b205cc0ed42fbec Bisecting: 14 revisions left to test after this (roughly 4 steps) [1f7ea54727caaa6701a15af0cbeddfdb015b2869] mailmap: update Gao Xiang's email addresses testing commit 1f7ea54727caaa6701a15af0cbeddfdb015b2869 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: bcb25a6206de676ffa699987fdcdfbaf3fa08026314ef468cd8dfd84159f3381 all runs: crashed: KASAN: use-after-free Read in ntfs_attr_find # git bisect bad 1f7ea54727caaa6701a15af0cbeddfdb015b2869 Bisecting: 5 revisions left to test after this (roughly 3 steps) [84ac013046ccc438af04b7acecd4d3ab84fe4bde] secretmem: fix unhandled fault in truncate testing commit 84ac013046ccc438af04b7acecd4d3ab84fe4bde compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 61640a15978586bf3ee4493b1adc11701094e884ad6e42712f61e80c6ed3a09e all runs: OK # git bisect good 84ac013046ccc438af04b7acecd4d3ab84fe4bde Bisecting: 2 revisions left to test after this (roughly 2 steps) [da9a298f5fad0dc615079a340da42928bc5b138e] hugetlb: fix memoryleak in hugetlb_mcopy_atomic_pte testing commit da9a298f5fad0dc615079a340da42928bc5b138e compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 9b51039f498562ca2bede46444f71ddbde75751a620623540d4356192b30c94e all runs: crashed: KASAN: use-after-free Read in ntfs_attr_find # git bisect bad da9a298f5fad0dc615079a340da42928bc5b138e Bisecting: 1 revision left to test after this (roughly 1 step) [38c9c22a85aeed28d0831f230136e9cf6fa2ed44] ntfs: fix use-after-free in ntfs_ucsncmp() testing commit 38c9c22a85aeed28d0831f230136e9cf6fa2ed44 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 0f355349563314a23a5546875877983d0b5a26f83532192b384a82ae51229c9a all runs: crashed: KASAN: use-after-free Read in ntfs_attr_find # git bisect bad 38c9c22a85aeed28d0831f230136e9cf6fa2ed44 38c9c22a85aeed28d0831f230136e9cf6fa2ed44 is the first bad commit commit 38c9c22a85aeed28d0831f230136e9cf6fa2ed44 Author: ChenXiaoSong Date: Thu Jul 7 18:53:29 2022 +0800 ntfs: fix use-after-free in ntfs_ucsncmp() Syzkaller reported use-after-free bug as follows: ================================================================== BUG: KASAN: use-after-free in ntfs_ucsncmp+0x123/0x130 Read of size 2 at addr ffff8880751acee8 by task a.out/879 CPU: 7 PID: 879 Comm: a.out Not tainted 5.19.0-rc4-next-20220630-00001-gcc5218c8bd2c-dirty #7 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x1c0/0x2b0 print_address_description.constprop.0.cold+0xd4/0x484 print_report.cold+0x55/0x232 kasan_report+0xbf/0xf0 ntfs_ucsncmp+0x123/0x130 ntfs_are_names_equal.cold+0x2b/0x41 ntfs_attr_find+0x43b/0xb90 ntfs_attr_lookup+0x16d/0x1e0 ntfs_read_locked_attr_inode+0x4aa/0x2360 ntfs_attr_iget+0x1af/0x220 ntfs_read_locked_inode+0x246c/0x5120 ntfs_iget+0x132/0x180 load_system_files+0x1cc6/0x3480 ntfs_fill_super+0xa66/0x1cf0 mount_bdev+0x38d/0x460 legacy_get_tree+0x10d/0x220 vfs_get_tree+0x93/0x300 do_new_mount+0x2da/0x6d0 path_mount+0x496/0x19d0 __x64_sys_mount+0x284/0x300 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f3f2118d9ea Code: 48 8b 0d a9 f4 0b 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 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 76 f4 0b 00 f7 d8 64 89 01 48 RSP: 002b:00007ffc269deac8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f3f2118d9ea RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffc269dec00 RBP: 00007ffc269dec80 R08: 00007ffc269deb00 R09: 00007ffc269dec44 R10: 0000000000000000 R11: 0000000000000202 R12: 000055f81ab1d220 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the physical page: page:0000000085430378 refcount:1 mapcount:1 mapping:0000000000000000 index:0x555c6a81d pfn:0x751ac memcg:ffff888101f7e180 anon flags: 0xfffffc00a0014(uptodate|lru|mappedtodisk|swapbacked|node=0|zone=1|lastcpupid=0x1fffff) raw: 000fffffc00a0014 ffffea0001bf2988 ffffea0001de2448 ffff88801712e201 raw: 0000000555c6a81d 0000000000000000 0000000100000000 ffff888101f7e180 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880751acd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880751ace00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880751ace80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff8880751acf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880751acf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== The reason is that struct ATTR_RECORD->name_offset is 6485, end address of name string is out of bounds. Fix this by adding sanity check on end address of attribute name string. [akpm@linux-foundation.org: coding-style cleanups] [chenxiaosong2@huawei.com: cleanup suggested by Hawkins Jiawei] Link: https://lkml.kernel.org/r/20220709064511.3304299-1-chenxiaosong2@huawei.com Link: https://lkml.kernel.org/r/20220707105329.4020708-1-chenxiaosong2@huawei.com Signed-off-by: ChenXiaoSong Signed-off-by: Hawkins Jiawei Cc: Anton Altaparmakov Cc: ChenXiaoSong Cc: Yongqiang Liu Cc: Zhang Yi Cc: Zhang Xiaoxu Signed-off-by: Andrew Morton fs/ntfs/attrib.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) culprit signature: 0f355349563314a23a5546875877983d0b5a26f83532192b384a82ae51229c9a parent signature: 61640a15978586bf3ee4493b1adc11701094e884ad6e42712f61e80c6ed3a09e revisions tested: 21, total time: 4h52m42.592679755s (build: 2h34m57.677689005s, test: 2h15m38.046650067s) first bad commit: 38c9c22a85aeed28d0831f230136e9cf6fa2ed44 ntfs: fix use-after-free in ntfs_ucsncmp() recipients (to): ["akpm@linux-foundation.org" "chenxiaosong2@huawei.com" "yin31149@gmail.com"] recipients (cc): [] crash: KASAN: use-after-free Read in ntfs_attr_find loop0: detected capacity change from 0 to 64 ntfs: (device loop0): is_boot_sector_ntfs(): Invalid end of sector marker. ================================================================== BUG: KASAN: use-after-free in ntfs_attr_find+0xaba/0xc30 fs/ntfs/attrib.c:597 Read of size 2 at addr ffff88807bd40009 by task syz-executor.0/4080 CPU: 0 PID: 4080 Comm: syz-executor.0 Not tainted 5.19.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x57/0x7d lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 ntfs_attr_find+0xaba/0xc30 fs/ntfs/attrib.c:597 ntfs_attr_lookup+0xe27/0x1f70 fs/ntfs/attrib.c:1193 ntfs_read_inode_mount+0x781/0x2110 fs/ntfs/inode.c:1845 ntfs_fill_super+0x1410/0x7b70 fs/ntfs/super.c:2854 mount_bdev+0x2cb/0x3b0 fs/super.c:1367 legacy_get_tree+0xfa/0x1f0 fs/fs_context.c:610 vfs_get_tree+0x7f/0x2c0 fs/super.c:1497 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x7e8/0x1a40 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x1f5/0x260 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f7ae428a7aa Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f7ae5482f88 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00007f7ae428a7aa RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f7ae5482fe0 RBP: 00007f7ae5483020 R08: 00007f7ae5483020 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000000 R13: 0000000020000100 R14: 00007f7ae5482fe0 R15: 0000000020086e00 Allocated by task 3949: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:600 [inline] tomoyo_print_header security/tomoyo/audit.c:156 [inline] tomoyo_init_log+0x183/0x1d00 security/tomoyo/audit.c:255 tomoyo_supervisor+0x2fc/0xc40 security/tomoyo/common.c:2088 tomoyo_audit_path_log security/tomoyo/file.c:168 [inline] tomoyo_path_permission security/tomoyo/file.c:587 [inline] tomoyo_path_permission+0x252/0x380 security/tomoyo/file.c:573 tomoyo_path_perm+0x289/0x350 security/tomoyo/file.c:838 security_inode_getattr+0xab/0x100 security/security.c:1344 vfs_getattr fs/stat.c:157 [inline] vfs_fstat+0x2b/0x80 fs/stat.c:182 __do_sys_newfstat+0x72/0xd0 fs/stat.c:435 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 3949: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x166/0x1a0 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1780 slab_free mm/slub.c:3536 [inline] kfree+0xd6/0x4d0 mm/slub.c:4584 tomoyo_init_log+0x11aa/0x1d00 security/tomoyo/audit.c:294 tomoyo_supervisor+0x2fc/0xc40 security/tomoyo/common.c:2088 tomoyo_audit_path_log security/tomoyo/file.c:168 [inline] tomoyo_path_permission security/tomoyo/file.c:587 [inline] tomoyo_path_permission+0x252/0x380 security/tomoyo/file.c:573 tomoyo_path_perm+0x289/0x350 security/tomoyo/file.c:838 security_inode_getattr+0xab/0x100 security/security.c:1344 vfs_getattr fs/stat.c:157 [inline] vfs_fstat+0x2b/0x80 fs/stat.c:182 __do_sys_newfstat+0x72/0xd0 fs/stat.c:435 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 The buggy address belongs to the object at ffff88807bd40000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 9 bytes inside of 4096-byte region [ffff88807bd40000, ffff88807bd41000) The buggy address belongs to the physical page: page:ffffea0001ef5000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7bd40 head:ffffea0001ef5000 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea00007f0a00 dead000000000003 ffff888010842140 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 3597, tgid 3593 (syz-fuzzer), ts 39709342262, free_ts 17018527962 prep_new_page mm/page_alloc.c:2456 [inline] get_page_from_freelist+0x19d3/0x3b30 mm/page_alloc.c:4198 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5426 alloc_slab_page mm/slub.c:1824 [inline] allocate_slab+0x26c/0x3c0 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x9bc/0xe10 mm/slub.c:3031 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3118 slab_alloc_node mm/slub.c:3209 [inline] slab_alloc mm/slub.c:3251 [inline] __kmalloc+0x318/0x350 mm/slub.c:4442 kmalloc include/linux/slab.h:605 [inline] tomoyo_realpath_from_path+0xb0/0x6a0 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x21c/0x2c0 security/tomoyo/file.c:771 security_file_open+0x34/0x80 security/security.c:1645 do_dentry_open+0x300/0xfe0 fs/open.c:835 do_open fs/namei.c:3520 [inline] path_openat+0x9cf/0x2360 fs/namei.c:3653 do_filp_open+0x199/0x3d0 fs/namei.c:3680 do_sys_openat2+0x11e/0x3f0 fs/open.c:1278 do_sys_open fs/open.c:1294 [inline] __do_sys_openat fs/open.c:1310 [inline] __se_sys_openat fs/open.c:1305 [inline] __x64_sys_openat+0x11b/0x1d0 fs/open.c:1305 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1371 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1421 free_unref_page_prepare mm/page_alloc.c:3343 [inline] free_unref_page+0x19/0x6a0 mm/page_alloc.c:3438 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2548 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:750 [inline] slab_alloc_node mm/slub.c:3243 [inline] kmem_cache_alloc_node+0x255/0x3f0 mm/slub.c:3293 __alloc_skb+0x151/0x270 net/core/skbuff.c:414 alloc_skb include/linux/skbuff.h:1426 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1191 [inline] netlink_sendmsg+0x805/0xc30 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:734 __sys_sendto+0x1a5/0x270 net/socket.c:2119 __do_sys_sendto net/socket.c:2131 [inline] __se_sys_sendto net/socket.c:2127 [inline] __x64_sys_sendto+0xd8/0x1b0 net/socket.c:2127 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Memory state around the buggy address: ffff88807bd3ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807bd3ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88807bd40000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807bd40080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807bd40100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================