KASAN: use-after-free Read in pppol2tp_session_init (2)

4 views
Skip to first unread message

syzbot

unread,
Jan 14, 2021, 11:13:24 AM1/14/21
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: f79dc860 Linux 4.14.215
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=157c4348d00000
kernel config: https://syzkaller.appspot.com/x/.config?x=9844af499cbb61c0
dashboard link: https://syzkaller.appspot.com/bug?extid=40ca26d3a4cd349a2e1f
compiler: gcc (GCC) 10.1.0-syz 20200507

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

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+40ca26...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:183 [inline]
BUG: KASAN: use-after-free in sk_dst_get include/net/sock.h:1769 [inline]
BUG: KASAN: use-after-free in pppol2tp_session_init+0x4b4/0x4d0 net/l2tp/l2tp_ppp.c:616
Read of size 8 at addr ffff88809961ea68 by task syz-executor.1/12460

CPU: 0 PID: 12460 Comm: syz-executor.1 Not tainted 4.14.215-syzkaller #0
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+0x1b2/0x283 lib/dump_stack.c:58
print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351
kasan_report mm/kasan/report.c:409 [inline]
__asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430
__read_once_size include/linux/compiler.h:183 [inline]
sk_dst_get include/net/sock.h:1769 [inline]
pppol2tp_session_init+0x4b4/0x4d0 net/l2tp/l2tp_ppp.c:616
pppol2tp_connect+0xd11/0x1370 net/l2tp/l2tp_ppp.c:790
SYSC_connect net/socket.c:1655 [inline]
SyS_connect+0x1f4/0x240 net/socket.c:1636
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x45e219
RSP: 002b:00007fcda3729c68 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045e219
RDX: 000000000000002e RSI: 0000000020000000 RDI: 0000000000000003
RBP: 000000000119bfc0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000119bf8c
R13: 00007ffde8c00c5f R14: 00007fcda372a9c0 R15: 000000000119bf8c

Allocated by task 12438:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
kmem_cache_alloc+0x124/0x3c0 mm/slab.c:3552
sk_prot_alloc+0x5f/0x290 net/core/sock.c:1461
sk_alloc+0x36/0xcd0 net/core/sock.c:1521
inet6_create net/ipv6/af_inet6.c:183 [inline]
inet6_create+0x2df/0xe20 net/ipv6/af_inet6.c:110
__sock_create+0x303/0x620 net/socket.c:1275
sock_create net/socket.c:1315 [inline]
SYSC_socket net/socket.c:1345 [inline]
SyS_socket+0xd1/0x1b0 net/socket.c:1325
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 12416:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
__cache_free mm/slab.c:3496 [inline]
kmem_cache_free+0x7c/0x2b0 mm/slab.c:3758
sk_prot_free net/core/sock.c:1502 [inline]
__sk_destruct+0x442/0x760 net/core/sock.c:1582
sk_destruct net/core/sock.c:1597 [inline]
__sk_free+0xd9/0x2d0 net/core/sock.c:1605
sk_free+0x2b/0x40 net/core/sock.c:1616
sock_put include/net/sock.h:1662 [inline]
l2tp_session_free+0x1a0/0x200 net/l2tp/l2tp_core.c:1718
l2tp_session_dec_refcount_1 net/l2tp/l2tp_core.h:303 [inline]
pppol2tp_session_destruct+0xcd/0x110 net/l2tp/l2tp_ppp.c:467
__sk_destruct+0x49/0x760 net/core/sock.c:1557
sk_destruct net/core/sock.c:1597 [inline]
__sk_free+0xd9/0x2d0 net/core/sock.c:1605
sk_free+0x2b/0x40 net/core/sock.c:1616
sock_put include/net/sock.h:1662 [inline]
pppol2tp_put_sk+0x4c/0x60 net/l2tp/l2tp_ppp.c:476
__rcu_reclaim kernel/rcu/rcu.h:195 [inline]
rcu_do_batch kernel/rcu/tree.c:2699 [inline]
invoke_rcu_callbacks kernel/rcu/tree.c:2962 [inline]
__rcu_process_callbacks kernel/rcu/tree.c:2929 [inline]
rcu_process_callbacks+0x780/0x1180 kernel/rcu/tree.c:2946
__do_softirq+0x254/0xa1d kernel/softirq.c:288

The buggy address belongs to the object at ffff88809961e840
which belongs to the cache UDPv6 of size 1728
The buggy address is located 552 bytes inside of
1728-byte region [ffff88809961e840, ffff88809961ef00)
The buggy address belongs to the page:
page:ffffea0002658780 count:1 mapcount:0 mapping:ffff88809961e100 index:0x0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff88809961e100 0000000000000000 0000000100000002
raw: ffffea0002908c60 ffffea0002af5fa0 ffff8880a57b41c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88809961e900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88809961e980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88809961ea00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88809961ea80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88809961eb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This report 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 issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Jun 27, 2021, 7:13:19 AM6/27/21
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: cfb41ef9 Linux 4.14.237
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=120b2b30300000
kernel config: https://syzkaller.appspot.com/x/.config?x=6343ebfee99e0959
dashboard link: https://syzkaller.appspot.com/bug?extid=40ca26d3a4cd349a2e1f
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=105162b4300000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=155c4088300000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+40ca26...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:183 [inline]
BUG: KASAN: use-after-free in sk_dst_get include/net/sock.h:1769 [inline]
BUG: KASAN: use-after-free in pppol2tp_session_init+0x4b4/0x4d0 net/l2tp/l2tp_ppp.c:616
Read of size 8 at addr ffff8880b57df9a8 by task syz-executor802/13150

CPU: 1 PID: 13150 Comm: syz-executor802 Not tainted 4.14.237-syzkaller #0
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+0x1b2/0x281 lib/dump_stack.c:58
print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
kasan_report mm/kasan/report.c:409 [inline]
__asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430
__read_once_size include/linux/compiler.h:183 [inline]
sk_dst_get include/net/sock.h:1769 [inline]
pppol2tp_session_init+0x4b4/0x4d0 net/l2tp/l2tp_ppp.c:616
pppol2tp_connect+0xd11/0x1370 net/l2tp/l2tp_ppp.c:790
SYSC_connect net/socket.c:1655 [inline]
SyS_connect+0x1f4/0x240 net/socket.c:1636
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x440ee9
RSP: 002b:00007ffd382ffe38 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000440ee9
RDX: 000000000000002e RSI: 0000000020000000 RDI: 0000000000000003
RBP: 0000000000000000 R08: 00007ffd382ffe80 R09: 00007ffd382ffe80
R10: 00007ffd382ffe80 R11: 0000000000000246 R12: 00007ffd382ffe6c
R13: 00007ffd382ffe80 R14: 00007ffd382ffec0 R15: 0000000000001422

Allocated by task 13136:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
kmem_cache_alloc+0x124/0x3c0 mm/slab.c:3552
sk_prot_alloc+0x5f/0x290 net/core/sock.c:1461
sk_alloc+0x36/0xcd0 net/core/sock.c:1521
inet6_create net/ipv6/af_inet6.c:183 [inline]
inet6_create+0x2df/0xe20 net/ipv6/af_inet6.c:110
__sock_create+0x303/0x620 net/socket.c:1275
sock_create net/socket.c:1315 [inline]
SYSC_socket net/socket.c:1345 [inline]
SyS_socket+0xd1/0x1b0 net/socket.c:1325
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 13150:
__do_softirq+0x24d/0x9ff kernel/softirq.c:288

The buggy address belongs to the object at ffff8880b57df780
which belongs to the cache UDPv6 of size 1728
The buggy address is located 552 bytes inside of
1728-byte region [ffff8880b57df780, ffff8880b57dfe40)
The buggy address belongs to the page:
page:ffffea0002d5f7c0 count:1 mapcount:0 mapping:ffff8880b57df040 index:0x0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880b57df040 0000000000000000 0000000100000002
raw: ffffea0002d3e5e0 ffffea00027b7260 ffff8882354b31c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880b57df880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880b57df900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880b57df980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880b57dfa00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880b57dfa80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Reply all
Reply to author
Forward
0 new messages