syzbot


KASAN: use-after-free Read in rxrpc_send_keepalive

Status: fixed on 2019/11/04 14:50
Subsystems: afs net
[Documentation on labels]
Reported-by: syzbot+d850c266e3df14da1d31@syzkaller.appspotmail.com
Fix commit: c48fc11b69e9 rxrpc: Fix call ref leak
First crash: 1892d, last: 1820d
Cause bisection: failed (error log, bisect log)
  
Duplicate bugs (6)
duplicates (6):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
general protection fault in selinux_socket_sendmsg selinux 5 1842d 1880d 0/28 closed as dup on 2019/08/22 13:35
KASAN: slab-out-of-bounds Read in rxrpc_send_keepalive afs net 5 1822d 1865d 0/28 closed as dup on 2019/09/05 14:01
general protection fault in smack_socket_sendmsg lsm 4 1844d 1871d 0/28 closed as dup on 2019/08/31 08:31
general protection fault in rxrpc_send_keepalive afs net 20 1825d 1890d 0/28 closed as dup on 2019/08/22 13:32
WARNING in aa_sock_msg_perm apparmor 1290 1820d 1889d 0/28 closed as dup on 2019/08/22 13:39
general protection fault in aa_sock_msg_perm apparmor 3 1826d 1859d 0/28 closed as dup on 2019/09/11 23:38
Discussions (13)
Title Replies (including bot) Last reply
[PATCH AUTOSEL 4.14 01/33] iommu/arm-smmu: Free context bitmap in the err path of arm_smmu_init_domain_context 37 (37) 2020/09/08 12:12
[PATCH 4.19 000/149] 4.19.82-stable review 169 (169) 2019/11/11 09:36
[PATCH 5.3 000/163] 5.3.9-stable review 174 (174) 2019/11/06 10:49
[PATCH 4.14 00/95] 4.14.152-stable review 102 (102) 2019/11/05 23:37
[PATCH AUTOSEL 4.19 01/59] tools: bpf: Use !building_out_of_srctree to determine srctree 59 (59) 2019/10/26 13:19
[PATCH AUTOSEL 5.3 01/99] tools: bpf: Use !building_out_of_srctree to determine srctree 98 (98) 2019/10/26 13:16
[PATCH AUTOSEL 4.19 01/37] PCI/ASPM: Do not initialize link state when aspm_disabled is set 37 (37) 2019/10/26 07:44
[PATCH AUTOSEL 5.3 01/33] net: ipv6: fix listify ip6_rcv_finish in case of forwarding 35 (35) 2019/10/25 15:49
[PATCH AUTOSEL 4.14 01/25] PCI/ASPM: Do not initialize link state when aspm_disabled is set 24 (24) 2019/10/25 13:57
[PATCH net 0/6] rxrpc: Syzbot-inspired fixes 8 (8) 2019/10/07 13:13
Re: KASAN: use-after-free Read in rxrpc_send_keepalive 1 (1) 2019/10/04 10:07
Reminder: 3 open syzbot reports in "net/rxrpc" subsystem 1 (1) 2019/10/04 04:13
KASAN: use-after-free Read in rxrpc_send_keepalive 0 (3) 2019/09/10 23:35
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in rxrpc_send_keepalive syz done 6 1811d 1884d 1/1 fixed on 2019/12/18 17:42
Last patch testing requests (1)
Created Duration User Patch Repo Result
2019/10/04 10:13 18m dhowells@redhat.com git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git 908b2297b94805ba825c82abb4acd06230a088a6 report log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in rxrpc_send_keepalive+0x8a2/0x940 net/rxrpc/output.c:634
Read of size 8 at addr ffff88809d9e8018 by task kworker/1:0/17

CPU: 1 PID: 17 Comm: kworker/1:0 Not tainted 5.4.0-rc3+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: krxrpcd rxrpc_peer_keepalive_worker
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x172/0x1f0 lib/dump_stack.c:113
 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374
 __kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506
 kasan_report+0x12/0x20 mm/kasan/common.c:634
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132
 rxrpc_send_keepalive+0x8a2/0x940 net/rxrpc/output.c:634
 rxrpc_peer_keepalive_dispatch net/rxrpc/peer_event.c:369 [inline]
 rxrpc_peer_keepalive_worker+0x7be/0xd02 net/rxrpc/peer_event.c:430
 process_one_work+0x9af/0x1740 kernel/workqueue.c:2269
 worker_thread+0x98/0xe40 kernel/workqueue.c:2415
 kthread+0x361/0x430 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

Allocated by task 16303:
 save_stack+0x23/0x90 mm/kasan/common.c:69
 set_track mm/kasan/common.c:77 [inline]
 __kasan_kmalloc mm/kasan/common.c:510 [inline]
 __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:483
 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:524
 kmem_cache_alloc_trace+0x158/0x790 mm/slab.c:3550
 kmalloc include/linux/slab.h:556 [inline]
 kzalloc include/linux/slab.h:690 [inline]
 rxrpc_alloc_connection+0x86/0x5f0 net/rxrpc/conn_object.c:41
 rxrpc_alloc_client_connection net/rxrpc/conn_client.c:176 [inline]
 rxrpc_get_client_conn net/rxrpc/conn_client.c:339 [inline]
 rxrpc_connect_call+0x648/0x4c00 net/rxrpc/conn_client.c:697
 rxrpc_new_client_call+0x978/0x19d0 net/rxrpc/call_object.c:289
 rxrpc_new_client_call_for_sendmsg net/rxrpc/sendmsg.c:595 [inline]
 rxrpc_do_sendmsg+0xff5/0x1d53 net/rxrpc/sendmsg.c:652
 rxrpc_sendmsg+0x4d6/0x5f0 net/rxrpc/af_rxrpc.c:585
 sock_sendmsg_nosec net/socket.c:637 [inline]
 sock_sendmsg+0xd7/0x130 net/socket.c:657
 ___sys_sendmsg+0x3e2/0x920 net/socket.c:2311
 __sys_sendmmsg+0x1bf/0x4d0 net/socket.c:2413
 __do_sys_sendmmsg net/socket.c:2442 [inline]
 __se_sys_sendmmsg net/socket.c:2439 [inline]
 __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2439
 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 16:
 save_stack+0x23/0x90 mm/kasan/common.c:69
 set_track mm/kasan/common.c:77 [inline]
 kasan_set_free_info mm/kasan/common.c:332 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/common.c:471
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:480
 __cache_free mm/slab.c:3425 [inline]
 kfree+0x10a/0x2c0 mm/slab.c:3756
 rxrpc_destroy_connection+0x1f2/0x2d0 net/rxrpc/conn_object.c:372
 __rcu_reclaim kernel/rcu/rcu.h:222 [inline]
 rcu_do_batch kernel/rcu/tree.c:2157 [inline]
 rcu_core+0x581/0x1560 kernel/rcu/tree.c:2377
 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2386
 __do_softirq+0x262/0x98c kernel/softirq.c:292

The buggy address belongs to the object at ffff88809d9e8000
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 24 bytes inside of
 1024-byte region [ffff88809d9e8000, ffff88809d9e8400)
The buggy address belongs to the page:
page:ffffea0002767a00 refcount:1 mapcount:0 mapping:ffff8880aa400c40 index:0x0
flags: 0x1fffc0000000200(slab)
raw: 01fffc0000000200 ffffea00026f78c8 ffffea00023ce148 ffff8880aa400c40
raw: 0000000000000000 ffff88809d9e8000 0000000100000002 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88809d9e7f00: fc fb fb fb fb fb fb fb fb fb fc fc fc fc fb fb
 ffff88809d9e7f80: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc
>ffff88809d9e8000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff88809d9e8080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88809d9e8100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (694):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/10/17 09:06 upstream bc88f85c6c09 8c88c9c1 .config console log report syz C ci-upstream-kasan-gce-root
2019/10/07 18:45 upstream b145b0eb2031 f3f7d9c8 .config console log report syz C ci-upstream-kasan-gce
2019/09/10 23:34 upstream 3120b9a6a3f7 a60cb4cd .config console log report syz C ci-upstream-kasan-gce-smack-root
2019/10/18 01:00 upstream 283ea345934d 8c88c9c1 .config console log report syz ci-upstream-kasan-gce-smack-root
2019/09/04 13:08 upstream 089cf7f6ecb2 12381952 .config console log report syz ci-upstream-kasan-gce-selinux-root
2019/09/04 10:44 upstream 089cf7f6ecb2 12381952 .config console log report syz ci-upstream-kasan-gce
2019/09/04 13:53 net-old e33b4325e60e 12381952 .config console log report syz ci-upstream-net-this-kasan-gce
2019/09/04 13:10 net-next-old 2c1f9e263444 12381952 .config console log report syz ci-upstream-net-kasan-gce
2019/09/04 13:10 linux-next 6d028043b55e 12381952 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2019/08/29 12:09 linux-next ed2393ca0910 fd37b39e .config console log report syz ci-upstream-linux-next-kasan-gce-root
2019/10/19 15:38 upstream b9959c7a347d 8c88c9c1 .config console log report ci-upstream-kasan-gce-selinux-root
2019/10/19 11:09 upstream b9959c7a347d 8c88c9c1 .config console log report ci-upstream-kasan-gce-root
2019/10/19 07:17 upstream b9959c7a347d 8c88c9c1 .config console log report ci-upstream-kasan-gce-root
2019/10/19 00:42 upstream b9959c7a347d 8c88c9c1 .config console log report ci-upstream-kasan-gce-selinux-root
2019/10/18 17:11 upstream 0e2adab6cf28 8c88c9c1 .config console log report ci-upstream-kasan-gce-smack-root
2019/10/18 15:39 upstream 0e2adab6cf28 8c88c9c1 .config console log report ci-upstream-kasan-gce
2019/10/18 08:50 upstream 283ea345934d 8c88c9c1 .config console log report ci-upstream-kasan-gce
2019/10/18 07:07 upstream 283ea345934d 8c88c9c1 .config console log report ci-upstream-kasan-gce
2019/10/18 05:09 upstream 283ea345934d 8c88c9c1 .config console log report ci-upstream-kasan-gce
2019/10/17 15:18 upstream bc88f85c6c09 8c88c9c1 .config console log report ci-upstream-kasan-gce-smack-root
2019/10/17 12:13 upstream bc88f85c6c09 8c88c9c1 .config console log report ci-upstream-kasan-gce-selinux-root
2019/10/16 20:59 upstream bc88f85c6c09 8c88c9c1 .config console log report ci-upstream-kasan-gce-root
2019/10/16 15:25 upstream 3b1f00aceb7a d4ea592f .config console log report ci-upstream-kasan-gce-root
2019/10/15 11:08 upstream 5bc52f64e884 b5268b89 .config console log report ci-upstream-kasan-gce-root
2019/10/15 09:37 upstream 5bc52f64e884 05ad7292 .config console log report ci-upstream-kasan-gce-selinux-root
2019/10/15 08:24 upstream 5bc52f64e884 05ad7292 .config console log report ci-upstream-kasan-gce-selinux-root
2019/10/15 02:18 upstream 4f5cafb5cb84 05ad7292 .config console log report ci-upstream-kasan-gce-smack-root
2019/10/14 12:56 upstream d4615e5a4680 a6aef847 .config console log report ci-upstream-kasan-gce-selinux-root
2019/10/14 05:36 upstream d4615e5a4680 2f661ec4 .config console log report ci-upstream-kasan-gce-selinux-root
2019/10/13 14:50 upstream da94001239cc 2f661ec4 .config console log report ci-upstream-kasan-gce
2019/10/13 11:25 upstream da94001239cc 2f661ec4 .config console log report ci-upstream-kasan-gce
2019/10/13 07:37 upstream 48acba989ed5 426631dd .config console log report ci-upstream-kasan-gce-root
2019/10/13 02:51 upstream 48acba989ed5 426631dd .config console log report ci-upstream-kasan-gce
2019/10/12 23:17 upstream 48acba989ed5 426631dd .config console log report ci-upstream-kasan-gce-smack-root
2019/10/12 14:44 upstream 1c0cc5f1ae5e 426631dd .config console log report ci-upstream-kasan-gce-selinux-root
2019/10/12 10:22 upstream 1c0cc5f1ae5e 426631dd .config console log report ci-upstream-kasan-gce-selinux-root
2019/08/09 15:43 upstream b678c568c561 ede31a9b .config console log report ci-upstream-kasan-gce-selinux-root
2019/10/06 06:12 net-old ef129d34149e f3f7d9c8 .config console log report ci-upstream-net-this-kasan-gce
2019/10/20 22:16 net-next-old ebcd670d05d5 8c88c9c1 .config console log report ci-upstream-net-kasan-gce
2019/10/20 13:58 net-next-old ebcd670d05d5 8c88c9c1 .config console log report ci-upstream-net-kasan-gce
2019/10/20 08:37 net-next-old ebcd670d05d5 8c88c9c1 .config console log report ci-upstream-net-kasan-gce
2019/10/20 04:24 net-next-old ebcd670d05d5 8c88c9c1 .config console log report ci-upstream-net-kasan-gce
2019/10/19 09:36 net-next-old ebcd670d05d5 8c88c9c1 .config console log report ci-upstream-net-kasan-gce
2019/10/19 08:19 net-next-old ebcd670d05d5 8c88c9c1 .config console log report ci-upstream-net-kasan-gce
2019/10/19 06:08 net-next-old ebcd670d05d5 8c88c9c1 .config console log report ci-upstream-net-kasan-gce
2019/10/18 23:20 net-next-old d9496f3ecfe4 8c88c9c1 .config console log report ci-upstream-net-kasan-gce
2019/10/17 23:18 net-next-old a8c41a68076e 8c88c9c1 .config console log report ci-upstream-net-kasan-gce
2019/10/17 15:30 net-next-old 2203cbf2c8b5 8c88c9c1 .config console log report ci-upstream-net-kasan-gce
2019/10/16 09:18 net-next-old 14f2cf607ccd d4ea592f .config console log report ci-upstream-net-kasan-gce
2019/10/15 14:25 net-next-old 85a83a8fca7f b5268b89 .config console log report ci-upstream-net-kasan-gce
2019/10/14 21:00 net-next-old 7e0d15ee0d8b 05ad7292 .config console log report ci-upstream-net-kasan-gce
2019/10/14 19:50 net-next-old 7e0d15ee0d8b 05ad7292 .config console log report ci-upstream-net-kasan-gce
2019/10/14 15:35 net-next-old 7e0d15ee0d8b 05ad7292 .config console log report ci-upstream-net-kasan-gce
2019/10/14 11:23 net-next-old 7e0d15ee0d8b a6aef847 .config console log report ci-upstream-net-kasan-gce
2019/10/14 08:43 net-next-old 7e0d15ee0d8b 2f661ec4 .config console log report ci-upstream-net-kasan-gce
2019/10/14 03:39 net-next-old c208bdb93788 2f661ec4 .config console log report ci-upstream-net-kasan-gce
2019/10/13 05:24 net-next-old 524900a212f4 426631dd .config console log report ci-upstream-net-kasan-gce
2019/10/12 18:16 net-next-old 524900a212f4 426631dd .config console log report ci-upstream-net-kasan-gce
2019/10/12 11:05 net-next-old 524900a212f4 426631dd .config console log report ci-upstream-net-kasan-gce
2019/10/12 07:04 net-next-old 41441d85b671 426631dd .config console log report ci-upstream-net-kasan-gce
2019/10/04 12:22 linux-next 311ef88adfa3 b2f369e5 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.