syzbot


KASAN: use-after-free Read in __vmalloc_node_range

Status: auto-closed as invalid on 2019/02/22 10:34
Subsystems: netfilter
[Documentation on labels]
Reported-by: syzbot+7d19ef2b23efd029af5c@syzkaller.appspotmail.com
First crash: 2211d, last: 2211d

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __vmalloc_area_node mm/vmalloc.c:1708 [inline]
BUG: KASAN: use-after-free in __vmalloc_node_range+0x648/0x650 mm/vmalloc.c:1759
Read of size 8 at addr ffff8801cf4e7020 by task syz-executor4/4508

CPU: 1 PID: 4508 Comm: syz-executor4 Not tainted 4.16.0+ #294
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1a7/0x27d lib/dump_stack.c:53
 print_address_description+0x73/0x250 mm/kasan/report.c:256
netlink: 'syz-executor1': attribute type 8 has an invalid length.
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report+0x23c/0x360 mm/kasan/report.c:412
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 __vmalloc_area_node mm/vmalloc.c:1708 [inline]
 __vmalloc_node_range+0x648/0x650 mm/vmalloc.c:1759
 __vmalloc_node mm/vmalloc.c:1804 [inline]
 __vmalloc_node_flags mm/vmalloc.c:1818 [inline]
 vzalloc+0x45/0x50 mm/vmalloc.c:1857
 alloc_counters.isra.11+0x9a/0x7d0 net/ipv4/netfilter/ip_tables.c:801
 copy_entries_to_user net/ipv4/netfilter/ip_tables.c:823 [inline]
 get_entries net/ipv4/netfilter/ip_tables.c:1025 [inline]
 do_ipt_get_ctl+0x63b/0xac0 net/ipv4/netfilter/ip_tables.c:1701
 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline]
 nf_getsockopt+0x6a/0xc0 net/netfilter/nf_sockopt.c:122
 ip_getsockopt+0x152/0x200 net/ipv4/ip_sockglue.c:1564
 tcp_getsockopt+0x82/0xd0 net/ipv4/tcp.c:3346
 sock_common_getsockopt+0x95/0xd0 net/core/sock.c:2998
 __sys_getsockopt+0x176/0x330 net/socket.c:1940
 SYSC_getsockopt net/socket.c:1951 [inline]
 SyS_getsockopt+0x38/0x50 net/socket.c:1948
 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x457dca
RSP: 002b:0000000000a3e328 EFLAGS: 00000202 ORIG_RAX: 0000000000000037
RAX: ffffffffffffffda RBX: 0000000000a3e350 RCX: 0000000000457dca
RDX: 0000000000000041 RSI: 0000000000000000 RDI: 0000000000000013
RBP: 00000000007031e0 R08: 0000000000a3e34c R09: 0000000000004000
R10: 0000000000a3e450 R11: 0000000000000202 R12: 0000000000000000
R13: 0000000000000013 R14: 0000000000000000 R15: 0000000000702460

Allocated by task 6688:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552
 kmem_cache_alloc_trace+0x136/0x740 mm/slab.c:3608
 kmalloc include/linux/slab.h:512 [inline]
 inotify_handle_event+0x22d/0x470 fs/notify/inotify/inotify_fsnotify.c:101
 inotify_ignored_and_remove_idr+0x32/0x80 fs/notify/inotify/inotify_user.c:476
 inotify_freeing_mark+0x1d/0x30 fs/notify/inotify/inotify_fsnotify.c:127
 fsnotify_free_mark+0xe2/0x130 fs/notify/mark.c:384
 fsnotify_destroy_mark+0x3e/0x50 fs/notify/mark.c:393
 SYSC_inotify_rm_watch fs/notify/inotify/inotify_user.c:755 [inline]
 SyS_inotify_rm_watch+0xd3/0x130 fs/notify/inotify/inotify_user.c:730
 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 2376:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527
 __cache_free mm/slab.c:3486 [inline]
 kfree+0xd9/0x260 mm/slab.c:3801
 inotify_free_event+0x15/0x20 fs/notify/inotify/inotify_fsnotify.c:176
 fsnotify_destroy_event.part.1+0x1a9/0x270 fs/notify/notification.c:87
 fsnotify_destroy_event+0x56/0x70 fs/notify/notification.c:74
 inotify_read+0x6ca/0x870 fs/notify/inotify/inotify_user.c:246
 __vfs_read+0xef/0xa00 fs/read_write.c:416
 vfs_read+0x11e/0x350 fs/read_write.c:452
 ksys_read+0xef/0x220 fs/read_write.c:578
 SYSC_read fs/read_write.c:588 [inline]
 SyS_read+0x24/0x30 fs/read_write.c:586
 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8801cf4e7000
 which belongs to the cache kmalloc-64 of size 64
The buggy address is located 32 bytes inside of
 64-byte region [ffff8801cf4e7000, ffff8801cf4e7040)
The buggy address belongs to the page:
page:ffffea00073d39c0 count:1 mapcount:0 mapping:ffff8801cf4e7000 index:0x0
flags: 0x2fffc0000000100(slab)
raw: 02fffc0000000100 ffff8801cf4e7000 0000000000000000 0000000100000020
raw: ffffea000723c4e0 ffffea0006bc51e0 ffff8801dac00340 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801cf4e6f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801cf4e6f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8801cf4e7000: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                               ^
 ffff8801cf4e7080: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc
 ffff8801cf4e7100: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/04/04 16:58 net-next-old 17dec0a94915 676bd07e .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.