Hello,
syzbot found the following crash on:
HEAD commit: 56aae8ee Merge remote-tracking branch 'origin/upstream-f2f..
git tree: android-4.14
console output:
https://syzkaller.appspot.com/x/log.txt?x=17d2923a400000
kernel config:
https://syzkaller.appspot.com/x/.config?x=a4bc2e53771f6a92
dashboard link:
https://syzkaller.appspot.com/bug?extid=00e97a57dd8ad4fbacd0
compiler: gcc (GCC) 8.0.1 20180413 (experimental)
syz repro:
https://syzkaller.appspot.com/x/repro.syz?x=12cbfe81400000
C reproducer:
https://syzkaller.appspot.com/x/repro.c?x=142058e6400000
IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by:
syzbot+00e97a...@syzkaller.appspotmail.com
raw_sendmsg: syz-executor044 forgot to set AF_INET. Fix it!
==================================================================
BUG: KASAN: use-after-free in ip_cmsg_recv_dstaddr
net/ipv4/ip_sockglue.c:165 [inline]
BUG: KASAN: use-after-free in ip_cmsg_recv_offset+0xcc6/0xde0
net/ipv4/ip_sockglue.c:228
Read of size 4 at addr ffff8801d21ce020 by task syz-executor044/1827
CPU: 1 PID: 1827 Comm: syz-executor044 Not tainted 4.14.72+ #11
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0xb9/0x11b lib/dump_stack.c:53
print_address_description+0x60/0x22b mm/kasan/report.c:252
kasan_report_error mm/kasan/report.c:351 [inline]
kasan_report.cold.6+0x11b/0x2dd mm/kasan/report.c:409
ip_cmsg_recv_dstaddr net/ipv4/ip_sockglue.c:165 [inline]
ip_cmsg_recv_offset+0xcc6/0xde0 net/ipv4/ip_sockglue.c:228
ip_cmsg_recv include/net/ip.h:634 [inline]
raw_recvmsg+0x552/0x6d0 net/ipv4/raw.c:791
inet_recvmsg+0x147/0x560 net/ipv4/af_inet.c:812
sock_recvmsg_nosec net/socket.c:818 [inline]
sock_recvmsg+0xc0/0x100 net/socket.c:825
sock_read_iter+0x239/0x340 net/socket.c:902
call_read_iter include/linux/fs.h:1776 [inline]
do_iter_readv_writev+0x473/0x560 fs/read_write.c:676
do_iter_read+0x212/0x580 fs/read_write.c:920
vfs_readv+0xe6/0x150 fs/read_write.c:984
do_readv+0xcc/0x240 fs/read_write.c:1017
do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x446579
RSP: 002b:00007f033dba0da8 EFLAGS: 00000293 ORIG_RAX: 0000000000000013
RAX: ffffffffffffffda RBX: 00000000006dbc28 RCX: 0000000000446579
RDX: 0000000000000001 RSI: 0000000020000500 RDI: 0000000000000003
RBP: 00000000006dbc20 R08: 000000000000006e R09: 0000000000000000
R10: 000000000000006e R11: 0000000000000293 R12: 00000000006dbc2c
R13: 00000000004ae620 R14: 0000000020001300 R15: 0000000000000000
Allocated by task 1820:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc.part.1+0x4f/0xd0 mm/kasan/kasan.c:551
slab_post_alloc_hook mm/slab.h:442 [inline]
slab_alloc_node mm/slub.c:2723 [inline]
slab_alloc mm/slub.c:2731 [inline]
__kmalloc_track_caller+0x104/0x300 mm/slub.c:4288
__kmalloc_reserve.isra.8+0x2f/0xc0 net/core/skbuff.c:137
__alloc_skb+0x105/0x550 net/core/skbuff.c:205
alloc_skb include/linux/skbuff.h:980 [inline]
sock_wmalloc+0xa5/0xf0 net/core/sock.c:1927
__ip_append_data.isra.2+0x1983/0x2020 net/ipv4/ip_output.c:978
ip_append_data.part.4+0xd8/0x150 net/ipv4/ip_output.c:1173
ip_append_data+0x5a/0x80 net/ipv4/ip_output.c:1162
raw_sendmsg+0xa33/0x2470 net/ipv4/raw.c:663
inet_sendmsg+0x168/0x540 net/ipv4/af_inet.c:781
sock_sendmsg_nosec net/socket.c:645 [inline]
sock_sendmsg+0xb5/0x100 net/socket.c:655
SYSC_sendto net/socket.c:1762 [inline]
SyS_sendto+0x211/0x340 net/socket.c:1730
do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7
Freed by task 1827:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_slab_free+0xac/0x190 mm/kasan/kasan.c:524
slab_free_hook mm/slub.c:1389 [inline]
slab_free_freelist_hook mm/slub.c:1410 [inline]
slab_free mm/slub.c:2966 [inline]
kfree+0xf5/0x310 mm/slub.c:3897
skb_free_head+0x83/0xa0 net/core/skbuff.c:550
pskb_expand_head+0x553/0xb30 net/core/skbuff.c:1491
__pskb_pull_tail+0xca/0x1500 net/core/skbuff.c:1887
pskb_may_pull include/linux/skbuff.h:2116 [inline]
ip_cmsg_recv_dstaddr net/ipv4/ip_sockglue.c:155 [inline]
ip_cmsg_recv_offset+0xbe2/0xde0 net/ipv4/ip_sockglue.c:228
ip_cmsg_recv include/net/ip.h:634 [inline]
raw_recvmsg+0x552/0x6d0 net/ipv4/raw.c:791
inet_recvmsg+0x147/0x560 net/ipv4/af_inet.c:812
sock_recvmsg_nosec net/socket.c:818 [inline]
sock_recvmsg+0xc0/0x100 net/socket.c:825
sock_read_iter+0x239/0x340 net/socket.c:902
call_read_iter include/linux/fs.h:1776 [inline]
do_iter_readv_writev+0x473/0x560 fs/read_write.c:676
do_iter_read+0x212/0x580 fs/read_write.c:920
vfs_readv+0xe6/0x150 fs/read_write.c:984
do_readv+0xcc/0x240 fs/read_write.c:1017
do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7
The buggy address belongs to the object at ffff8801d21ce000
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 32 bytes inside of
512-byte region [ffff8801d21ce000, ffff8801d21ce200)
The buggy address belongs to the page:
page:ffffea0007487380 count:1 mapcount:0 mapping: (null) index:0x0
compound_mapcount: 0
flags: 0x4000000000008100(slab|head)
raw: 4000000000008100 0000000000000000 0000000000000000 00000001000c000c
raw: ffffea000748f000 0000000400000004 ffff8801da802c00 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff8801d21cdf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8801d21cdf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
> ffff8801d21ce000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8801d21ce080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8801d21ce100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
---
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 can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches