syzbot


KASAN: use-after-free Read in exact_lock (2)

Status: auto-obsoleted due to no activity on 2025/07/29 08:03
First crash: 179d, last: 107d
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-54 KASAN: use-after-free Read in exact_lock 19 1 978d 978d 0/2 auto-obsoleted due to no activity on 2023/04/22 15:12
android-5-10 KASAN: use-after-free Read in exact_lock (2) 19 172 45d 124d 0/2 premoderation: reported on 2025/04/26 10:29
android-5-10 KASAN: use-after-free Read in exact_lock 19 53 176d 186d 0/2 auto-obsoleted due to no activity on 2025/04/24 06:37

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in get_disk_and_module block/genhd.c:1524 [inline]
BUG: KASAN: use-after-free in exact_lock+0x38/0xc0 block/genhd.c:594
Read of size 8 at addr ffff8881f0b0e4d0 by task syz.1.1204/5054

CPU: 0 PID: 5054 Comm: syz.1.1204 Tainted: G        W         5.4.292-syzkaller-00021-gcd8e74fa0fa3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
 __dump_stack+0x1e/0x20 lib/dump_stack.c:77
 dump_stack+0x15b/0x1b8 lib/dump_stack.c:118
 print_address_description+0x8d/0x4c0 mm/kasan/report.c:384
 __kasan_report+0xef/0x120 mm/kasan/report.c:516
 kasan_report+0x30/0x60 mm/kasan/common.c:653
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132
 get_disk_and_module block/genhd.c:1524 [inline]
 exact_lock+0x38/0xc0 block/genhd.c:594
 kobj_lookup+0x298/0x430 drivers/base/map.c:119
 get_gendisk+0xe9/0x340 block/genhd.c:879
 bdev_get_gendisk fs/block_dev.c:1105 [inline]
 __blkdev_get+0x125/0x1560 fs/block_dev.c:1560
 blkdev_get+0x68/0x380 fs/block_dev.c:1714
 blkdev_open+0x1cb/0x2b0 fs/block_dev.c:1856
 do_dentry_open+0x8b5/0x1030 fs/open.c:806
 vfs_open+0x73/0x80 fs/open.c:920
 do_last fs/namei.c:3565 [inline]
 path_openat+0x2a5e/0x35c0 fs/namei.c:3683
 do_filp_open+0x1ae/0x3f0 fs/namei.c:3713
 do_sys_open+0x2bb/0x5d0 fs/open.c:1123
 ksys_open include/linux/syscalls.h:1388 [inline]
 __do_sys_creat fs/open.c:1181 [inline]
 __se_sys_creat fs/open.c:1179 [inline]
 __x64_sys_creat+0x65/0x70 fs/open.c:1179
 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x5c/0xc1
RIP: 0033:0x7f147d5ab969
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f147bc14038 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 00007f147d7d2fa0 RCX: 00007f147d5ab969
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00002000000000c0
RBP: 00007f147d62dab1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f147d7d2fa0 R15: 00007ffc1992fb38

Allocated by task 4924:
 save_stack mm/kasan/common.c:70 [inline]
 set_track mm/kasan/common.c:78 [inline]
 __kasan_kmalloc+0x162/0x200 mm/kasan/common.c:529
 kasan_slab_alloc+0x12/0x20 mm/kasan/common.c:537
 slab_post_alloc_hook mm/slab.h:584 [inline]
 slab_alloc_node mm/slub.c:2829 [inline]
 slab_alloc mm/slub.c:2837 [inline]
 __kmalloc_track_caller+0x10d/0x2d0 mm/slub.c:4449
 __kmalloc_reserve net/core/skbuff.c:142 [inline]
 pskb_expand_head+0x123/0x1110 net/core/skbuff.c:1653
 netlink_trim+0x1ae/0x250 net/netlink/af_netlink.c:1288
 netlink_broadcast_filtered+0x75/0x1290 net/netlink/af_netlink.c:1493
 netlink_broadcast net/netlink/af_netlink.c:1538 [inline]
 nlmsg_multicast include/net/netlink.h:968 [inline]
 nlmsg_notify+0xed/0x1b0 net/netlink/af_netlink.c:2510
 rtnl_notify net/core/rtnetlink.c:737 [inline]
 rtmsg_ifinfo_send net/core/rtnetlink.c:3552 [inline]
 rtmsg_ifinfo_event net/core/rtnetlink.c:3567 [inline]
 rtmsg_ifinfo+0xea/0x130 net/core/rtnetlink.c:3573
 register_netdevice+0xfca/0x12a0 net/core/dev.c:9261
 register_netdev+0x3e/0x50 net/core/dev.c:9338
 ip6_tnl_init_net+0x2d2/0x380 net/ipv6/ip6_tunnel.c:2261
 ops_init+0x1ba/0x4a0 net/core/net_namespace.c:141
 setup_net+0x20c/0x9b0 net/core/net_namespace.c:348
 copy_net_ns+0x314/0x520 net/core/net_namespace.c:489
 create_new_namespaces+0x49c/0x590 kernel/nsproxy.c:103
 unshare_nsproxy_namespaces+0x120/0x170 kernel/nsproxy.c:202
 ksys_unshare+0x4a4/0x7d0 kernel/fork.c:2908
 __do_sys_unshare kernel/fork.c:2976 [inline]
 __se_sys_unshare kernel/fork.c:2974 [inline]
 __x64_sys_unshare+0x38/0x40 kernel/fork.c:2974
 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x5c/0xc1

Freed by task 4924:
 save_stack mm/kasan/common.c:70 [inline]
 set_track mm/kasan/common.c:78 [inline]
 kasan_set_free_info mm/kasan/common.c:345 [inline]
 __kasan_slab_free+0x1c3/0x280 mm/kasan/common.c:487
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:496
 slab_free_hook mm/slub.c:1455 [inline]
 slab_free_freelist_hook+0xb7/0x180 mm/slub.c:1494
 slab_free mm/slub.c:3080 [inline]
 kfree+0xbe/0x260 mm/slub.c:4071
 skb_free_head net/core/skbuff.c:601 [inline]
 skb_release_data+0x4ea/0x610 net/core/skbuff.c:621
 skb_release_all net/core/skbuff.c:675 [inline]
 __kfree_skb net/core/skbuff.c:689 [inline]
 consume_skb+0xad/0x240 net/core/skbuff.c:849
 netlink_broadcast_filtered+0x1198/0x1290 net/netlink/af_netlink.c:1516
 netlink_broadcast net/netlink/af_netlink.c:1538 [inline]
 nlmsg_multicast include/net/netlink.h:968 [inline]
 nlmsg_notify+0xed/0x1b0 net/netlink/af_netlink.c:2510
 rtnl_notify net/core/rtnetlink.c:737 [inline]
 rtmsg_ifinfo_send net/core/rtnetlink.c:3552 [inline]
 rtmsg_ifinfo_event net/core/rtnetlink.c:3567 [inline]
 rtmsg_ifinfo+0xea/0x130 net/core/rtnetlink.c:3573
 register_netdevice+0xfca/0x12a0 net/core/dev.c:9261
 register_netdev+0x3e/0x50 net/core/dev.c:9338
 ip6_tnl_init_net+0x2d2/0x380 net/ipv6/ip6_tunnel.c:2261
 ops_init+0x1ba/0x4a0 net/core/net_namespace.c:141
 setup_net+0x20c/0x9b0 net/core/net_namespace.c:348
 copy_net_ns+0x314/0x520 net/core/net_namespace.c:489
 create_new_namespaces+0x49c/0x590 kernel/nsproxy.c:103
 unshare_nsproxy_namespaces+0x120/0x170 kernel/nsproxy.c:202
 ksys_unshare+0x4a4/0x7d0 kernel/fork.c:2908
 __do_sys_unshare kernel/fork.c:2976 [inline]
 __se_sys_unshare kernel/fork.c:2974 [inline]
 __x64_sys_unshare+0x38/0x40 kernel/fork.c:2974
 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x5c/0xc1

The buggy address belongs to the object at ffff8881f0b0e000
 which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 1232 bytes inside of
 2048-byte region [ffff8881f0b0e000, ffff8881f0b0e800)
The buggy address belongs to the page:
page:ffffea0007c2c200 refcount:1 mapcount:0 mapping:ffff8881f5c0c000 index:0x0 compound_mapcount: 0
flags: 0x8000000000010200(slab|head)
raw: 8000000000010200 0000000000000000 0000000100000001 ffff8881f5c0c000
raw: 0000000000000000 0000000000080008 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL)
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook mm/page_alloc.c:2165 [inline]
 prep_new_page+0x35e/0x370 mm/page_alloc.c:2171
 get_page_from_freelist+0x1296/0x1310 mm/page_alloc.c:3794
 __alloc_pages_nodemask+0x202/0x4b0 mm/page_alloc.c:4894
 alloc_slab_page+0x3c/0x3b0 mm/slub.c:343
 allocate_slab mm/slub.c:1683 [inline]
 new_slab+0x93/0x420 mm/slub.c:1749
 new_slab_objects mm/slub.c:2505 [inline]
 ___slab_alloc+0x29e/0x420 mm/slub.c:2667
 __slab_alloc+0x63/0xa0 mm/slub.c:2707
 slab_alloc_node mm/slub.c:2792 [inline]
 slab_alloc mm/slub.c:2837 [inline]
 kmem_cache_alloc_trace+0x130/0x290 mm/slub.c:2854
 kmalloc include/linux/slab.h:556 [inline]
 kzalloc include/linux/slab.h:690 [inline]
 alloc_super+0x5e/0x7a0 fs/super.c:203
 sget_fc+0x20a/0x600 fs/super.c:532
 vfs_get_super fs/super.c:1197 [inline]
 get_tree_single+0x2f/0x170 fs/super.c:1240
 sel_get_tree+0x1c/0x20 security/selinux/selinuxfs.c:2084
 vfs_get_tree+0x89/0x260 fs/super.c:1558
 fc_mount fs/namespace.c:962 [inline]
 vfs_kern_mount+0xcd/0x160 fs/namespace.c:992
 kern_mount+0x43/0x90 fs/namespace.c:3819
 init_sel_fs+0x160/0x26c security/selinux/selinuxfs.c:2131
page_owner free stack trace missing

Memory state around the buggy address:
 ffff8881f0b0e380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881f0b0e400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881f0b0e480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                 ^
 ffff8881f0b0e500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881f0b0e580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (14):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/13 13:56 android12-5.4 cd8e74fa0fa3 f6671af7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in exact_lock
2025/05/13 05:55 android12-5.4 cd8e74fa0fa3 f6671af7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in exact_lock
2025/05/13 01:16 android12-5.4 cd8e74fa0fa3 f6671af7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in exact_lock
2025/05/12 00:48 android12-5.4 cd8e74fa0fa3 77908e5f .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in exact_lock
2025/05/10 18:50 android12-5.4 cd8e74fa0fa3 77908e5f .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in exact_lock
2025/05/09 12:25 android12-5.4 cd8e74fa0fa3 bb813bcc .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in exact_lock
2025/05/08 00:38 android12-5.4 cd8e74fa0fa3 dbf35fa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in exact_lock
2025/05/06 00:38 android12-5.4 cd8e74fa0fa3 6ca47dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in exact_lock
2025/04/28 08:06 android12-5.4 cd8e74fa0fa3 c6b4fb39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in exact_lock
2025/04/27 14:53 android12-5.4 cd8e74fa0fa3 c6b4fb39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in exact_lock
2025/04/26 09:21 android12-5.4 cd8e74fa0fa3 c6b4fb39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in exact_lock
2025/03/17 03:50 android12-5.4 6b07fcd94a6a e2826670 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in exact_lock
2025/03/10 00:05 android12-5.4 6b07fcd94a6a 163f510d .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in exact_lock
2025/03/02 07:47 android12-5.4 6b07fcd94a6a c3901742 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in exact_lock
* Struck through repros no longer work on HEAD.