KASAN: slab-out-of-bounds Read in tipc_nl_name_table_dump

4 views
Skip to first unread message

syzbot

unread,
Apr 16, 2019, 2:46:06 PM4/16/19
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 9c69a132 route: Avoid crash from dereferencing NULL rt->from
git tree: net
console output: https://syzkaller.appspot.com/x/log.txt?x=12a815bf200000
kernel config: https://syzkaller.appspot.com/x/.config?x=4fb64439e07a1ec0
dashboard link: https://syzkaller.appspot.com/bug?extid=67e46d867a28e57485c2
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
CC: [da...@davemloft.net jon....@ericsson.com
linux-...@vger.kernel.org net...@vger.kernel.org
tipc-di...@lists.sourceforge.net ying...@windriver.com
net...@vger.kernel.org]

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+67e46d...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: slab-out-of-bounds in __tipc_nl_add_nametable_publ
net/tipc/name_table.c:815 [inline]
BUG: KASAN: slab-out-of-bounds in __tipc_nl_service_range_list
net/tipc/name_table.c:885 [inline]
BUG: KASAN: slab-out-of-bounds in tipc_nl_service_list
net/tipc/name_table.c:926 [inline]
BUG: KASAN: slab-out-of-bounds in tipc_nl_name_table_dump+0x15c4/0x1720
net/tipc/name_table.c:960
Read of size 4 at addr ffff888061d11778 by task syz-executor.2/7028

CPU: 1 PID: 7028 Comm: syz-executor.2 Not tainted 5.1.0-rc4+ #168
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
print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187
kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317
__asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131
__tipc_nl_add_nametable_publ net/tipc/name_table.c:815 [inline]
__tipc_nl_service_range_list net/tipc/name_table.c:885 [inline]
tipc_nl_service_list net/tipc/name_table.c:926 [inline]
tipc_nl_name_table_dump+0x15c4/0x1720 net/tipc/name_table.c:960
__tipc_nl_compat_dumpit.isra.0+0x220/0x930 net/tipc/netlink_compat.c:206
tipc_nl_compat_dumpit+0x209/0x4d0 net/tipc/netlink_compat.c:286
tipc_nl_compat_handle net/tipc/netlink_compat.c:1243 [inline]
tipc_nl_compat_recv+0x34f/0xb30 net/tipc/netlink_compat.c:1281
genl_family_rcv_msg+0x6e1/0xd90 net/netlink/genetlink.c:602
genl_rcv_msg+0xca/0x16c net/netlink/genetlink.c:627
netlink_rcv_skb+0x17a/0x460 net/netlink/af_netlink.c:2486
genl_rcv+0x29/0x40 net/netlink/genetlink.c:638
netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
netlink_unicast+0x536/0x720 net/netlink/af_netlink.c:1337
netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1926
sock_sendmsg_nosec net/socket.c:651 [inline]
sock_sendmsg+0xdd/0x130 net/socket.c:661
___sys_sendmsg+0x806/0x930 net/socket.c:2260
__sys_sendmsg+0x105/0x1d0 net/socket.c:2298
__do_sys_sendmsg net/socket.c:2307 [inline]
__se_sys_sendmsg net/socket.c:2305 [inline]
__x64_sys_sendmsg+0x78/0xb0 net/socket.c:2305
do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x458c29
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:00007f297b972c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000458c29
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000005
RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f297b9736d4
R13: 00000000004cd008 R14: 00000000004dab20 R15: 00000000ffffffff

Allocated by task 5805:
save_stack+0x45/0xd0 mm/kasan/common.c:75
set_track mm/kasan/common.c:87 [inline]
__kasan_kmalloc mm/kasan/common.c:497 [inline]
__kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470
kasan_kmalloc+0x9/0x10 mm/kasan/common.c:511
__do_kmalloc mm/slab.c:3728 [inline]
__kmalloc+0x15c/0x740 mm/slab.c:3737
kmalloc include/linux/slab.h:552 [inline]
kzalloc include/linux/slab.h:742 [inline]
ext4_htree_store_dirent+0x8a/0x650 fs/ext4/dir.c:450
htree_dirblock_to_tree+0x4fe/0x910 fs/ext4/namei.c:1021
ext4_htree_fill_tree+0x252/0xa50 fs/ext4/namei.c:1098
ext4_dx_readdir fs/ext4/dir.c:574 [inline]
ext4_readdir+0x1999/0x3490 fs/ext4/dir.c:121
iterate_dir+0x489/0x5f0 fs/readdir.c:51
__do_sys_getdents fs/readdir.c:231 [inline]
__se_sys_getdents fs/readdir.c:212 [inline]
__x64_sys_getdents+0x1dd/0x370 fs/readdir.c:212
do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 5805:
save_stack+0x45/0xd0 mm/kasan/common.c:75
set_track mm/kasan/common.c:87 [inline]
__kasan_slab_free+0x102/0x150 mm/kasan/common.c:459
kasan_slab_free+0xe/0x10 mm/kasan/common.c:467
__cache_free mm/slab.c:3500 [inline]
kfree+0xcf/0x230 mm/slab.c:3823
free_rb_tree_fname+0x87/0xe0 fs/ext4/dir.c:402
ext4_htree_free_dir_info fs/ext4/dir.c:424 [inline]
ext4_release_dir+0x46/0x70 fs/ext4/dir.c:622
__fput+0x2e5/0x8d0 fs/file_table.c:278
____fput+0x16/0x20 fs/file_table.c:309
task_work_run+0x14a/0x1c0 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:188 [inline]
exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:166
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

The buggy address belongs to the object at ffff888061d11700
which belongs to the cache kmalloc-64 of size 64
The buggy address is located 56 bytes to the right of
64-byte region [ffff888061d11700, ffff888061d11740)
The buggy address belongs to the page:
page:ffffea0001874440 count:1 mapcount:0 mapping:ffff88812c3f0340
index:0xffff888061d11e80
flags: 0x1fffc0000000200(slab)
raw: 01fffc0000000200 ffffea000249d4c8 ffffea0002280888 ffff88812c3f0340
raw: ffff888061d11e80 ffff888061d11000 000000010000001e 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff888061d11600: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff888061d11680: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
> ffff888061d11700: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
^
ffff888061d11780: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
ffff888061d11800: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Dec 4, 2019, 1:59:04 PM12/4/19
to syzkaller-upst...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages