KASAN: use-after-free Read in rxrpc_free_skb

5 views
Skip to first unread message

syzbot

unread,
Jul 7, 2020, 9:16:15 AM7/7/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: b850307b Linux 4.14.184
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14073847100000
kernel config: https://syzkaller.appspot.com/x/.config?x=ddc0f08dd6b981c5
dashboard link: https://syzkaller.appspot.com/bug?extid=035037e4ef75f3713845
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

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+035037...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:183 [inline]
BUG: KASAN: use-after-free in atomic_read arch/x86/include/asm/atomic.h:27 [inline]
BUG: KASAN: use-after-free in refcount_read include/linux/refcount.h:42 [inline]
BUG: KASAN: use-after-free in skb_unref include/linux/skbuff.h:952 [inline]
BUG: KASAN: use-after-free in kfree_skb+0x2df/0x340 net/core/skbuff.c:659
Read of size 4 at addr ffff8880a9546c64 by task kworker/1:4/7545

CPU: 1 PID: 7545 Comm: kworker/1:4 Not tainted 4.14.184-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: krxrpcd rxrpc_process_call
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x1b2/0x283 lib/dump_stack.c:58
print_address_description.cold+0x54/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+0xa9/0x2b9 mm/kasan/report.c:393
__read_once_size include/linux/compiler.h:183 [inline]
atomic_read arch/x86/include/asm/atomic.h:27 [inline]
refcount_read include/linux/refcount.h:42 [inline]
skb_unref include/linux/skbuff.h:952 [inline]
kfree_skb+0x2df/0x340 net/core/skbuff.c:659
rxrpc_free_skb+0xcb/0x350 net/rxrpc/skbuff.c:67
rxrpc_resend net/rxrpc/call_event.c:323 [inline]
rxrpc_process_call+0xd32/0x1147 net/rxrpc/call_event.c:407
process_one_work+0x7c0/0x14c0 kernel/workqueue.c:2116
worker_thread+0x5d7/0x1080 kernel/workqueue.c:2250
kthread+0x30d/0x420 kernel/kthread.c:232
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Allocated by task 20597:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc.part.0+0x4f/0xd0 mm/kasan/kasan.c:551
kmem_cache_alloc_node+0x146/0x400 mm/slab.c:3642
__alloc_skb+0x9a/0x4c0 net/core/skbuff.c:193
alloc_skb include/linux/skbuff.h:980 [inline]
alloc_skb_with_frags+0x85/0x500 net/core/skbuff.c:5228
sock_alloc_send_pskb+0x57b/0x6d0 net/core/sock.c:2081
rxrpc_send_data+0x1499/0x2740 net/rxrpc/sendmsg.c:280
rxrpc_do_sendmsg+0x9a0/0x1023 net/rxrpc/sendmsg.c:636
rxrpc_sendmsg+0x47d/0x5a0 net/rxrpc/af_rxrpc.c:543
sock_sendmsg_nosec net/socket.c:646 [inline]
sock_sendmsg+0xb5/0x100 net/socket.c:656
___sys_sendmsg+0x349/0x840 net/socket.c:2062
__sys_sendmmsg+0x129/0x330 net/socket.c:2152
SYSC_sendmmsg net/socket.c:2183 [inline]
SyS_sendmmsg+0x2f/0x50 net/socket.c:2178
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 20595:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_slab_free+0xaf/0x190 mm/kasan/kasan.c:524
__cache_free mm/slab.c:3496 [inline]
kmem_cache_free+0x7c/0x2b0 mm/slab.c:3758
kfree_skbmem+0x98/0x100 net/core/skbuff.c:586
__kfree_skb net/core/skbuff.c:646 [inline]
kfree_skb+0xb6/0x340 net/core/skbuff.c:663
rxrpc_free_skb+0xcb/0x350 net/rxrpc/skbuff.c:67
rxrpc_release_call+0x4d7/0xa10 net/rxrpc/call_object.c:512
rxrpc_release_calls_on_socket+0x583/0xbb0 net/rxrpc/call_object.c:599
rxrpc_release_sock net/rxrpc/af_rxrpc.c:851 [inline]
rxrpc_release+0x270/0x531 net/rxrpc/af_rxrpc.c:881
__sock_release+0xcd/0x2b0 net/socket.c:602
sock_close+0x15/0x20 net/socket.c:1139
__fput+0x25f/0x7a0 fs/file_table.c:210
task_work_run+0x113/0x190 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:191 [inline]
exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164
prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297
entry_SYSCALL_64_after_hwframe+0x46/0xbb

The buggy address belongs to the object at ffff8880a9546b80
which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 228 bytes inside of
232-byte region [ffff8880a9546b80, ffff8880a9546c68)
The buggy address belongs to the page:
page:ffffea0002a55180 count:1 mapcount:0 mapping:ffff8880a9546040 index:0xffff8880a9546cc0
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffff8880a9546040 ffff8880a9546cc0 000000010000000a
raw: ffffea00025cb5a0 ffffea00020b99a0 ffff8880a9e0fa80 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880a9546b00: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc
ffff8880a9546b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880a9546c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
^
ffff8880a9546c80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
ffff8880a9546d00: 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

unread,
Nov 4, 2020, 8:16:11 AM11/4/20
to syzkaller...@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