syzbot


KASAN: use-after-free Read in x25_write_internal

Status: auto-closed as invalid on 2019/08/18 22:53
Subsystems: x25
[Documentation on labels]
Reported-by: syzbot+426b913e690764e50c83@syzkaller.appspotmail.com
First crash: 1942d, last: 1889d
Discussions (2)
Title Replies (including bot) Last reply
Reminder: 5 open syzbot bugs in "net/x25" subsystem 1 (1) 2019/07/24 02:28
KASAN: use-after-free Read in x25_write_internal 0 (1) 2019/01/02 11:02

Sample crash report:
netlink: 3 bytes leftover after parsing attributes in process `syz-executor.4'.
netlink: 3 bytes leftover after parsing attributes in process `syz-executor.4'.
net_ratelimit: 2 callbacks suppressed
A link change request failed with some changes committed already. Interface hsr_slave_0 may have been left with an inconsistent configuration, please check.
==================================================================
BUG: KASAN: use-after-free in x25_write_internal+0xcff/0xdf0 net/x25/x25_subr.c:173
Read of size 4 at addr ffff8880940cd15c by task syz-executor.1/9804

CPU: 0 PID: 9804 Comm: syz-executor.1 Not tainted 5.0.0-rc6+ #85
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x172/0x1f0 lib/dump_stack.c:113
device ifb0 entered promiscuous mode
 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187
netlink: 3 bytes leftover after parsing attributes in process `syz-executor.4'.
 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:134
netlink: 3 bytes leftover after parsing attributes in process `syz-executor.4'.
 x25_write_internal+0xcff/0xdf0 net/x25/x25_subr.c:173
A link change request failed with some changes committed already. Interface hsr_slave_0 may have been left with an inconsistent configuration, please check.
 x25_release+0xd0/0x340 net/x25/af_x25.c:658
 __sock_release+0xd3/0x250 net/socket.c:579
 sock_close+0x1b/0x30 net/socket.c:1139
 __fput+0x2df/0x8d0 fs/file_table.c:278
 ____fput+0x16/0x20 fs/file_table.c:309
 task_work_run+0x14a/0x1c0 kernel/task_work.c:113
 get_signal+0x1961/0x1d50 kernel/signal.c:2388
 do_signal+0x87/0x1940 arch/x86/kernel/signal.c:816
 exit_to_usermode_loop+0x244/0x2c0 arch/x86/entry/common.c:162
 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:268 [inline]
 do_syscall_64+0x52d/0x610 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x457e29
Code: ad b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 7b b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fbc98ae9c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: fffffffffffffe00 RBX: 0000000000000003 RCX: 0000000000457e29
RDX: 0000000000000012 RSI: 00000000200005c0 RDI: 0000000000000005
RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fbc98aea6d4
R13: 00000000004be362 R14: 00000000004ceaf8 R15: 00000000ffffffff

Allocated by task 17708:
 save_stack+0x45/0xd0 mm/kasan/common.c:73
 set_track mm/kasan/common.c:85 [inline]
 __kasan_kmalloc mm/kasan/common.c:496 [inline]
 __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:469
 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:504
 kmem_cache_alloc_trace+0x151/0x760 mm/slab.c:3609
 kmalloc include/linux/slab.h:545 [inline]
 x25_link_device_up+0x46/0x3f0 net/x25/x25_link.c:249
 x25_device_event+0x116/0x2b0 net/x25/af_x25.c:242
 notifier_call_chain+0xc7/0x240 kernel/notifier.c:93
 __raw_notifier_call_chain kernel/notifier.c:394 [inline]
 raw_notifier_call_chain+0x2e/0x40 kernel/notifier.c:401
 call_netdevice_notifiers_info+0x3f/0x90 net/core/dev.c:1739
 call_netdevice_notifiers_extack net/core/dev.c:1751 [inline]
 call_netdevice_notifiers net/core/dev.c:1765 [inline]
 __dev_notify_flags+0x121/0x2c0 net/core/dev.c:7605
 dev_change_flags+0x10d/0x170 net/core/dev.c:7643
 dev_ifsioc+0x2b0/0x940 net/core/dev_ioctl.c:237
 dev_ioctl+0x1b8/0xc70 net/core/dev_ioctl.c:488
 sock_do_ioctl+0x1bd/0x300 net/socket.c:972
 sock_ioctl+0x32b/0x610 net/socket.c:1073
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:509 [inline]
 do_vfs_ioctl+0xd6e/0x1390 fs/ioctl.c:696
 ksys_ioctl+0xab/0xd0 fs/ioctl.c:713
 __do_sys_ioctl fs/ioctl.c:720 [inline]
 __se_sys_ioctl fs/ioctl.c:718 [inline]
 __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718
 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 9804:
 save_stack+0x45/0xd0 mm/kasan/common.c:73
 set_track mm/kasan/common.c:85 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/common.c:458
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:466
 __cache_free mm/slab.c:3487 [inline]
 kfree+0xcf/0x230 mm/slab.c:3806
 x25_neigh_put include/net/x25.h:253 [inline]
 x25_connect+0x8d8/0xde0 net/x25/af_x25.c:821
 __sys_connect+0x266/0x330 net/socket.c:1662
 __do_sys_connect net/socket.c:1673 [inline]
 __se_sys_connect net/socket.c:1670 [inline]
 __x64_sys_connect+0x73/0xb0 net/socket.c:1670
 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8880940cd140
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 28 bytes inside of
 256-byte region [ffff8880940cd140, ffff8880940cd240)
The buggy address belongs to the page:
page:ffffea0002503340 count:1 mapcount:0 mapping:ffff88812c3f07c0 index:0xffff8880940cd3c0
flags: 0x1fffc0000000200(slab)
raw: 01fffc0000000200 ffffea00024f5e88 ffffea00022b5f48 ffff88812c3f07c0
raw: ffff8880940cd3c0 ffff8880940cd000 0000000100000003 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880940cd000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8880940cd080: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
>ffff8880940cd100: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
                                                    ^
 ffff8880940cd180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880940cd200: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================

Crashes (22):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/02/19 22:52 net-old 1f43f400a2cb 4df543c9 .config console log report ci-upstream-net-this-kasan-gce
2019/02/13 20:50 net-old 2fdeee254923 0a49c954 .config console log report ci-upstream-net-this-kasan-gce
2019/02/10 02:56 net-old 225d94642685 d75f7686 .config console log report ci-upstream-net-this-kasan-gce
2019/02/07 19:52 net-old e8c32c32b48c aa4feb03 .config console log report ci-upstream-net-this-kasan-gce
2019/01/22 22:14 net-old 56cb4e503499 b1ff06b2 .config console log report ci-upstream-net-this-kasan-gce
2019/01/22 13:44 net-old 49a57857aeea 985f75cc .config console log report ci-upstream-net-this-kasan-gce
2019/01/01 06:26 net-old 756af9c64232 3d85f48c .config console log report ci-upstream-net-this-kasan-gce
2018/12/29 19:23 net-old 7418e6520f22 a40793d7 .config console log report ci-upstream-net-this-kasan-gce
2019/02/19 06:27 net-next-old 8bbed40f107f 59f36113 .config console log report ci-upstream-net-kasan-gce
2019/02/12 06:48 net-next-old b904aada8033 65a0d619 .config console log report ci-upstream-net-kasan-gce
2019/02/11 19:36 net-next-old 6a98afbbb4af 73f5f452 .config console log report ci-upstream-net-kasan-gce
2019/02/11 01:36 net-next-old 193dad2abb62 b4f792e4 .config console log report ci-upstream-net-kasan-gce
2019/02/07 13:01 net-next-old 22087d659212 aa4feb03 .config console log report ci-upstream-net-kasan-gce
2019/02/02 16:04 net-next-old d6b0a01faa6a c198d5dd .config console log report ci-upstream-net-kasan-gce
2019/01/25 05:23 net-next-old 254764e55652 bfab9cd8 .config console log report ci-upstream-net-kasan-gce
2019/01/24 01:58 net-next-old 33a0efa4baec 56558f63 .config console log report ci-upstream-net-kasan-gce
2019/01/21 18:44 net-next-old 28f9d1a3d4fe badbbeee .config console log report ci-upstream-net-kasan-gce
2019/01/17 23:42 net-next-old 44543f1dd2a3 769e75ed .config console log report ci-upstream-net-kasan-gce
2019/01/17 07:45 net-next-old bdbe8cc1a30c c2faf9b2 .config console log report ci-upstream-net-kasan-gce
2019/01/15 22:54 net-next-old 7939f8beecf1 79cb1a7c .config console log report ci-upstream-net-kasan-gce
2019/01/14 08:30 net-next-old b71acb0e3721 c3f3344c .config console log report ci-upstream-net-kasan-gce
2019/01/09 13:04 net-next-old b71acb0e3721 45c0c1b1 .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.