syzbot


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

Status: fixed on 2019/11/30 21:02
Reported-by: syzbot+f085fa3366e324343c66@syzkaller.appspotmail.com
Fix commit: d93fb604c079 tipc: fix modprobe tipc failed after switch order of device registration
First crash: 2051d, last: 2015d
Fix bisection: fixed by (bisect log) :
commit 403eac979a5b455e7a155e6a833c6c72bafba1b7
Author: Junwei Hu <hujunwei4@huawei.com>
Date: Fri May 17 11:27:34 2019 +0000

  tipc: fix modprobe tipc failed after switch order of device registration

  
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Read in erspan_build_header net C 30 2485d 2494d 4/28 fixed on 2018/02/01 04:00

Sample crash report:
IPv6: ADDRCONF(NETDEV_CHANGE): hsr0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): hsr_slave_1: link becomes ready
IPv6: ADDRCONF(NETDEV_UP): vxcan1: link is not ready
8021q: adding VLAN 0 to HW filter on device batadv0
==================================================================
BUG: KASAN: slab-out-of-bounds in erspan_build_header+0x392/0x3b0 net/ipv4/ip_gre.c:706
Read of size 2 at addr ffff8880a0265c8b by task syz-executor344/7131

CPU: 1 PID: 7131 Comm: syz-executor344 Not tainted 4.14.114 #4
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+0x138/0x19c lib/dump_stack.c:53
 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xaf/0x2b5 mm/kasan/report.c:393
 __asan_report_load_n_noabort+0xf/0x20 mm/kasan/report.c:440
 erspan_build_header+0x392/0x3b0 net/ipv4/ip_gre.c:706
 erspan_xmit net/ipv4/ip_gre.c:748 [inline]
 erspan_xmit+0x3ec/0x11c0 net/ipv4/ip_gre.c:725
 __netdev_start_xmit include/linux/netdevice.h:4033 [inline]
 netdev_start_xmit include/linux/netdevice.h:4042 [inline]
 packet_direct_xmit+0x438/0x640 net/packet/af_packet.c:269
 packet_snd net/packet/af_packet.c:2969 [inline]
 packet_sendmsg+0x31e1/0x5990 net/packet/af_packet.c:2994
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xd0/0x110 net/socket.c:656
 ___sys_sendmsg+0x70c/0x850 net/socket.c:2062
 __sys_sendmsg+0xb9/0x140 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x2d/0x50 net/socket.c:2103
 do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x441a29
RSP: 002b:00007ffc5ce97728 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000441a29
RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000003
RBP: 00000000004a9750 R08: 0000000001bbbbbb R09: 0000000001bbbbbb
R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000402f10
R13: 0000000000402fa0 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 6043:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
 kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:489
 kmem_cache_alloc+0x12e/0x780 mm/slab.c:3552
 getname_flags fs/namei.c:138 [inline]
 getname_flags+0xcb/0x580 fs/namei.c:128
 user_path_at_empty+0x2f/0x50 fs/namei.c:2630
 user_path_at include/linux/namei.h:57 [inline]
 SYSC_faccessat fs/open.c:384 [inline]
 SyS_faccessat fs/open.c:353 [inline]
 SYSC_access fs/open.c:431 [inline]
 SyS_access+0x1ed/0x670 fs/open.c:429
 do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 6043:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kmem_cache_free+0x83/0x2b0 mm/slab.c:3758
 putname+0xdb/0x120 fs/namei.c:259
 filename_lookup+0x23a/0x380 fs/namei.c:2385
 user_path_at_empty+0x43/0x50 fs/namei.c:2630
 user_path_at include/linux/namei.h:57 [inline]
 SYSC_faccessat fs/open.c:384 [inline]
 SyS_faccessat fs/open.c:353 [inline]
 SYSC_access fs/open.c:431 [inline]
 SyS_access+0x1ed/0x670 fs/open.c:429
 do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8880a0264580
 which belongs to the cache names_cache of size 4096
The buggy address is located 1803 bytes to the right of
 4096-byte region [ffff8880a0264580, ffff8880a0265580)
The buggy address belongs to the page:
page:ffffea0002809900 count:1 mapcount:0 mapping:ffff8880a0264580 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000008100(slab|head)
raw: 01fffc0000008100 ffff8880a0264580 0000000000000000 0000000100000001
raw: ffffea000217a420 ffffea0002172620 ffff8880aa9e0cc0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a0265b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880a0265c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880a0265c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                      ^
 ffff8880a0265d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880a0265d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/04/27 13:31 linux-4.14.y fa5941f45d7e b617407b .config console log report syz C ci2-linux-4-14
2019/05/17 11:49 linux-4.14.y e6fedb8802c7 2755003a .config console log report ci2-linux-4-14
2019/05/08 21:16 linux-4.14.y b4677bbb658d 1bb034d0 .config console log report ci2-linux-4-14
2019/04/30 19:57 linux-4.14.y fa5941f45d7e 618456b4 .config console log report ci2-linux-4-14
2019/04/27 12:46 linux-4.14.y fa5941f45d7e b617407b .config console log report ci2-linux-4-14
2019/04/24 20:04 linux-4.14.y 68d7a45eec10 8e3c52b1 .config console log report ci2-linux-4-14
2019/04/23 07:39 linux-4.14.y 68d7a45eec10 53199d6e .config console log report ci2-linux-4-14
2019/04/11 12:26 linux-4.14.y 1ec8f1f0bffe e955ac50 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.