syzbot


KASAN: use-after-free Read in p9_conn_cancel
Status: upstream: reported C repro on 2018/07/09 05:52
Reported-by: syzbot+f0fdc967350bd580a80b@syzkaller.appspotmail.com
First crash: 1417d, last: 1379d

Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: BUG: unable to handle kernel NULL pointer dereference in p9_conn_cancel (log)
Repro: C syz .config

Fix bisection: fixed by (bisect log) [merge commit]:
commit 5695d5d1970f975de059bb6dec76941440f62488
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Sat Aug 18 17:21:49 2018 +0000

  Merge tag 'usb-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-49 KASAN: use-after-free Read in p9_conn_cancel C 81 1367d 1141d 0/3 public: reported C repro on 2019/04/11 08:44

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in p9_conn_cancel+0x9fc/0xd30 net/9p/trans_fd.c:227
Read of size 8 at addr ffff8801d9bac020 by task kworker/1:0/19

CPU: 1 PID: 19 Comm: kworker/1:0 Not tainted 4.18.0-rc8+ #181
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
9pnet: Insufficient options for proto=fd
Workqueue: events p9_poll_workfn
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113
 print_address_description+0x6c/0x20b mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 p9_conn_cancel+0x9fc/0xd30 net/9p/trans_fd.c:227
 p9_poll_mux net/9p/trans_fd.c:620 [inline]
 p9_poll_workfn+0x4b2/0x6d0 net/9p/trans_fd.c:1107
 process_one_work+0xc73/0x1ba0 kernel/workqueue.c:2153
 worker_thread+0x189/0x13c0 kernel/workqueue.c:2296
 kthread+0x345/0x410 kernel/kthread.c:246
 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:412

Allocated by task 4514:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553
 kmem_cache_alloc_trace+0x152/0x780 mm/slab.c:3620
 kmalloc include/linux/slab.h:513 [inline]
 kzalloc include/linux/slab.h:707 [inline]
 p9_fd_open net/9p/trans_fd.c:796 [inline]
 p9_fd_create+0x1a7/0x3f0 net/9p/trans_fd.c:1036
 p9_client_create+0x8ed/0x1770 net/9p/client.c:1063
 v9fs_session_init+0x21a/0x1a80 fs/9p/v9fs.c:400
 v9fs_mount+0x7c/0x900 fs/9p/vfs_super.c:135
 mount_fs+0xae/0x328 fs/super.c:1277
 vfs_kern_mount.part.34+0xdc/0x4e0 fs/namespace.c:1037
 vfs_kern_mount fs/namespace.c:1027 [inline]
 do_new_mount fs/namespace.c:2518 [inline]
 do_mount+0x581/0x30e0 fs/namespace.c:2848
 ksys_mount+0x12d/0x140 fs/namespace.c:3064
 __do_sys_mount fs/namespace.c:3078 [inline]
 __se_sys_mount fs/namespace.c:3075 [inline]
 __x64_sys_mount+0xbe/0x150 fs/namespace.c:3075
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 4514:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528
 __cache_free mm/slab.c:3498 [inline]
 kfree+0xd9/0x260 mm/slab.c:3813
 p9_fd_close+0x416/0x5b0 net/9p/trans_fd.c:893
 p9_client_create+0xa9a/0x1770 net/9p/client.c:1077
 v9fs_session_init+0x21a/0x1a80 fs/9p/v9fs.c:400
 v9fs_mount+0x7c/0x900 fs/9p/vfs_super.c:135
 mount_fs+0xae/0x328 fs/super.c:1277
 vfs_kern_mount.part.34+0xdc/0x4e0 fs/namespace.c:1037
 vfs_kern_mount fs/namespace.c:1027 [inline]
 do_new_mount fs/namespace.c:2518 [inline]
 do_mount+0x581/0x30e0 fs/namespace.c:2848
 ksys_mount+0x12d/0x140 fs/namespace.c:3064
 __do_sys_mount fs/namespace.c:3078 [inline]
 __se_sys_mount fs/namespace.c:3075 [inline]
 __x64_sys_mount+0xbe/0x150 fs/namespace.c:3075
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8801d9bac000
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 32 bytes inside of
 512-byte region [ffff8801d9bac000, ffff8801d9bac200)
The buggy address belongs to the page:
page:ffffea000766eb00 count:1 mapcount:0 mapping:ffff8801dac00940 index:0x0
flags: 0x2fffc0000000100(slab)
raw: 02fffc0000000100 ffffea000766af08 ffffea0007664e48 ffff8801dac00940
raw: 0000000000000000 ffff8801d9bac000 0000000100000006 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801d9babf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801d9babf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8801d9bac000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                               ^
 ffff8801d9bac080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801d9bac100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (72):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2018/08/09 10:51 upstream fedb8da96355 2eeda842 .config log report syz C
ci-upstream-kasan-gce-root 2018/07/23 07:19 upstream d72e90f33aa4 8cc079c3 .config log report syz C
ci-upstream-kasan-gce-root 2018/07/23 00:25 upstream 45ae4df92207 8cc079c3 .config log report syz C
ci-upstream-kasan-gce-root 2018/07/22 19:00 upstream 45ae4df92207 8cc079c3 .config log report syz C
ci-upstream-kasan-gce-root 2018/07/22 02:33 upstream 490fc053865c 8cc079c3 .config log report syz C
ci-upstream-kasan-gce-root 2018/07/22 00:18 upstream 490fc053865c 8cc079c3 .config log report syz C
ci-upstream-kasan-gce 2018/07/12 06:56 upstream c25c74b7476e 2e0e3130 .config log report syz C
ci-upstream-kasan-gce-root 2018/07/11 12:53 upstream 1e09177acae3 2e0e3130 .config log report syz C
ci-upstream-kasan-gce-root 2018/07/10 11:41 upstream 092150a25cb7 9fa03fa5 .config log report syz C
ci-upstream-kasan-gce-root 2018/07/09 19:51 upstream 1e4b044d2251 f25e5770 .config log report syz C
ci-upstream-kasan-gce-386 2018/07/10 19:07 upstream 092150a25cb7 9fa03fa5 .config log report syz C
ci-upstream-kasan-gce-386 2018/07/10 04:46 upstream 092150a25cb7 f25e5770 .config log report syz C
ci-upstream-kasan-gce-386 2018/07/09 17:19 upstream 1e4b044d2251 f25e5770 .config log report syz C
ci-upstream-kasan-gce-root 2018/08/07 16:13 upstream 1236568ee3cb 1beb8136 .config log report syz
ci-upstream-kasan-gce-root 2018/08/01 07:04 upstream c1d61e7fe376 1477993e .config log report syz
ci-upstream-kasan-gce-root 2018/08/16 14:03 upstream f91e654474d4 9ccc1d45 .config log report
ci-upstream-kasan-gce-root 2018/08/15 15:19 upstream 31130a16d459 9ccc1d45 .config log report
ci-upstream-kasan-gce-root 2018/08/14 14:01 upstream 10f3e23f07cb 7a88b141 .config log report
ci-upstream-kasan-gce-root 2018/08/12 23:45 upstream d6dd6431591b 7a88b141 .config log report
ci-upstream-kasan-gce-root 2018/08/10 05:40 upstream 112cbae26d18 1fb62d58 .config log report
ci-upstream-kasan-gce-root 2018/08/09 14:34 upstream fedb8da96355 1fb62d58 .config log report
ci-upstream-kasan-gce-root 2018/08/08 18:36 upstream 1236568ee3cb ddeb9f8d .config log report
ci-upstream-kasan-gce-root 2018/08/08 08:40 upstream 1236568ee3cb 1beb8136 .config log report
ci-upstream-kasan-gce-root 2018/08/07 20:03 upstream 1236568ee3cb 1beb8136 .config log report
ci-upstream-kasan-gce-root 2018/08/07 14:10 upstream 1236568ee3cb 1beb8136 .config log report
ci-upstream-kasan-gce-root 2018/08/07 00:28 upstream 1ffaddd029c8 1beb8136 .config log report
ci-upstream-kasan-gce-root 2018/08/06 18:15 upstream 1ffaddd029c8 1beb8136 .config log report
ci-upstream-kasan-gce-root 2018/08/06 04:55 upstream a8c199208cd6 1beb8136 .config log report
ci-upstream-kasan-gce-root 2018/08/06 03:39 upstream a8c199208cd6 1beb8136 .config log report
ci-upstream-kasan-gce-root 2018/08/06 00:57 upstream a8c199208cd6 1beb8136 .config log report
ci-upstream-kasan-gce-root 2018/08/05 20:05 upstream a8c199208cd6 1beb8136 .config log report
ci-upstream-kasan-gce-root 2018/08/05 00:03 upstream 0b5b1f9a78b5 3476a2df .config log report
ci-upstream-kasan-gce-root 2018/08/04 19:31 upstream 0b5b1f9a78b5 3476a2df .config log report
ci-upstream-kasan-gce-root 2018/08/04 18:29 upstream 0b5b1f9a78b5 3476a2df .config log report
ci-upstream-kasan-gce-root 2018/08/04 13:29 upstream 0b5b1f9a78b5 df7f6947 .config log report
ci-upstream-kasan-gce-root 2018/08/04 04:59 upstream 0b5b1f9a78b5 df7f6947 .config log report
ci-upstream-kasan-gce-root 2018/08/03 19:38 upstream 0585df468e8f cc4f6d0a .config log report
ci-upstream-kasan-gce-root 2018/08/03 07:35 upstream e30cb13c5a09 5b7e23bb .config log report
ci-upstream-kasan-gce-root 2018/08/02 17:19 upstream 6b4703768268 0a7cf4ec .config log report
ci-upstream-kasan-gce-root 2018/08/02 15:31 upstream 6b4703768268 0a7cf4ec .config log report
ci-upstream-kasan-gce-root 2018/08/01 12:52 upstream c1d61e7fe376 1477993e .config log report
ci-upstream-kasan-gce-root 2018/08/01 07:33 upstream c1d61e7fe376 1477993e .config log report
ci-upstream-kasan-gce-root 2018/08/01 01:19 upstream c1d61e7fe376 1477993e .config log report
ci-upstream-kasan-gce-root 2018/07/30 22:04 upstream acb1872577b3 1a381291 .config log report
ci-upstream-kasan-gce-root 2018/07/30 15:16 upstream acb1872577b3 1a381291 .config log report
ci-upstream-kasan-gce-root 2018/07/30 10:42 upstream acb1872577b3 1a381291 .config log report
ci-upstream-kasan-gce-root 2018/07/30 06:32 upstream 3cfb6772d4cf 1a381291 .config log report
ci-upstream-kasan-gce-root 2018/07/29 21:24 upstream 3cfb6772d4cf 1a381291 .config log report
ci-upstream-kasan-gce-root 2018/07/23 20:26 upstream d72e90f33aa4 912c93d7 .config log report
ci-upstream-kasan-gce-root 2018/07/23 05:27 upstream d72e90f33aa4 8cc079c3 .config log report
ci-upstream-kasan-gce-root 2018/07/19 15:25 upstream 024ddc0ce104 49f35839 .config log report
ci-upstream-kasan-gce-root 2018/07/19 03:12 upstream 04a132065175 49f35839 .config log report
ci-upstream-kasan-gce-root 2018/07/18 22:58 upstream 04a132065175 49f35839 .config log report
ci-upstream-kasan-gce 2018/07/12 10:26 upstream c25c74b7476e 2e0e3130 .config log report
ci-upstream-kasan-gce 2018/07/08 23:07 upstream ca04b3cca11a f25e5770 .config log report
ci-upstream-linux-next-kasan-gce-root 2018/07/29 05:19 linux-next d1e0b8e0cb7a ebf656d7 .config log report
ci-upstream-linux-next-kasan-gce-root 2018/07/23 12:05 linux-next 89cf55353308 f69c5fcd .config log report