md/raid1:md0: active with 1 out of 1027 mirrors md0: detected capacity change from 0 to 5884 ================================================================================ UBSAN: array-index-out-of-bounds in drivers/md/md.c:1390:20 index 1027 is out of range for type 'mdp_disk_t[27]' (aka 'struct mdp_device_descriptor_s[27]') CPU: 1 PID: 4480 Comm: syz.0.17 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call trace: dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf4/0x15c lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 ubsan_epilogue+0x14/0x48 lib/ubsan.c:151 __ubsan_handle_out_of_bounds+0xd0/0xf8 lib/ubsan.c:282 super_90_validate+0x110c/0x15b8 drivers/md/md.c:1390 add_bound_rdev+0x128/0x494 drivers/md/md.c:2908 md_add_new_disk+0xc0c/0x1484 drivers/md/md.c:-1 md_ioctl+0x2158/0x25cc drivers/md/md.c:7807 blkdev_ioctl+0x654/0xb74 block/ioctl.c:626 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x12c arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:589 ================================================================================ ================================================================== BUG: KASAN: slab-out-of-bounds in super_90_validate+0x1128/0x15b8 drivers/md/md.c:1392 Read of size 4 at addr ffff0000c3d2b390 by task syz.0.17/4480 CPU: 1 PID: 4480 Comm: syz.0.17 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call trace: dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf4/0x15c lib/dump_stack.c:106 print_address_description+0x88/0x218 mm/kasan/report.c:316 print_report+0x50/0x68 mm/kasan/report.c:420 kasan_report+0xa8/0xfc mm/kasan/report.c:524 __asan_report_load4_noabort+0x2c/0x38 mm/kasan/report_generic.c:350 super_90_validate+0x1128/0x15b8 drivers/md/md.c:1392 add_bound_rdev+0x128/0x494 drivers/md/md.c:2908 md_add_new_disk+0xc0c/0x1484 drivers/md/md.c:-1 md_ioctl+0x2158/0x25cc drivers/md/md.c:7807 blkdev_ioctl+0x654/0xb74 block/ioctl.c:626 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x12c arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:589 Allocated by task 4444: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:53 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:375 [inline] __kasan_kmalloc+0xa0/0xb8 mm/kasan/common.c:384 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:936 [inline] __kmalloc_node_track_caller+0xcc/0x174 mm/slab_common.c:956 kmemdup+0x5c/0x98 mm/util.c:129 kmemdup include/linux/fortify-string.h:585 [inline] __devinet_sysctl_register+0xc0/0xdac net/ipv4/devinet.c:2600 devinet_sysctl_register+0x14c/0x1c0 net/ipv4/devinet.c:2652 inetdev_init+0x268/0x4a0 net/ipv4/devinet.c:280 inetdev_event+0xef4/0x12dc net/ipv4/devinet.c:1547 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0xd8/0x168 kernel/notifier.c:455 call_netdevice_notifiers_info net/core/dev.c:2014 [inline] call_netdevice_notifiers_extack net/core/dev.c:2052 [inline] call_netdevice_notifiers+0x110/0x198 net/core/dev.c:2066 register_netdevice+0x11c4/0x1650 net/core/dev.c:10299 __ip_tunnel_create+0x2a8/0x3b4 net/ipv4/ip_tunnel.c:267 ip_tunnel_init_net+0x23c/0x638 net/ipv4/ip_tunnel.c:1104 erspan_init_net+0x38/0x48 net/ipv4/ip_gre.c:1742 ops_init+0x2b0/0x53c net/core/net_namespace.c:138 setup_net+0x494/0xb6c net/core/net_namespace.c:336 copy_net_ns+0x2b8/0x578 net/core/net_namespace.c:508 create_new_namespaces+0x30c/0x604 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x108/0x160 kernel/nsproxy.c:226 ksys_unshare+0x3f0/0x70c kernel/fork.c:3289 __do_sys_unshare kernel/fork.c:3363 [inline] __se_sys_unshare kernel/fork.c:3361 [inline] __arm64_sys_unshare+0x3c/0x50 kernel/fork.c:3361 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x12c arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:589 Freed by task 11: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:53 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:516 ____kasan_slab_free+0x148/0x1b0 mm/kasan/common.c:237 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:245 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1735 [inline] slab_free_freelist_hook+0x16c/0x1e8 mm/slub.c:1761 slab_free mm/slub.c:3694 [inline] __kmem_cache_free+0xbc/0x21c mm/slub.c:3707 kfree+0xd0/0x1a8 mm/slab_common.c:988 __devinet_sysctl_unregister net/ipv4/devinet.c:2636 [inline] devinet_sysctl_unregister net/ipv4/devinet.c:2663 [inline] inetdev_destroy net/ipv4/devinet.c:329 [inline] inetdev_event+0x554/0x12dc net/ipv4/devinet.c:1615 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0xd8/0x168 kernel/notifier.c:455 call_netdevice_notifiers_info net/core/dev.c:2014 [inline] call_netdevice_notifiers_extack net/core/dev.c:2052 [inline] call_netdevice_notifiers net/core/dev.c:2066 [inline] unregister_netdevice_many_notify+0xf18/0x1900 net/core/dev.c:11047 unregister_netdevice_many+0x28/0x38 net/core/dev.c:11101 ip_tunnel_delete_nets+0x2d8/0x334 net/ipv4/ip_tunnel.c:1157 erspan_exit_batch_net+0x30/0x40 net/ipv4/ip_gre.c:1748 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x650/0xa90 net/core/net_namespace.c:640 process_one_work+0x7e4/0x13bc kernel/workqueue.c:2292 worker_thread+0x8cc/0xfe8 kernel/workqueue.c:2439 kthread+0x254/0x2e0 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854 The buggy address belongs to the object at ffff0000c3d2a000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 912 bytes to the right of 4096-byte region [ffff0000c3d2a000, ffff0000c3d2b000) The buggy address belongs to the physical page: page:00000000e9c07508 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103d28 head:00000000e9c07508 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff0000eee95101 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 0000000000000000 dead000000000122 ffff0000c0003500 raw: 0000000000000000 0000000000040004 00000001ffffffff ffff0000eee95101 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000c3d2b280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000c3d2b300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000c3d2b380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff0000c3d2b400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000c3d2b480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================