syzbot


KASAN: null-ptr-deref Read in refcount_sub_and_test_checked

Status: fixed on 2018/11/12 21:25
Subsystems: media
[Documentation on labels]
Fix commit: fda21d46cce2 ipv6: do not leave garbage in rt->fib6_metrics
First crash: 2198d, last: 2166d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: null-ptr-deref Read in refcount_sub_and_test_checked (2) media C inconclusive done 916 1956d 2158d 15/28 fixed on 2020/02/18 10:28

Sample crash report:
==================================================================
BUG: KASAN: null-ptr-deref in atomic_read include/asm-generic/atomic-instrumented.h:21 [inline]
BUG: KASAN: null-ptr-deref in refcount_sub_and_test_checked+0x9d/0x310 lib/refcount.c:179
Read of size 4 at addr 0000000000000020 by task syz-executor801/5703

CPU: 1 PID: 5703 Comm: syz-executor801 Not tainted 4.19.0+ #98
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x244/0x39d lib/dump_stack.c:113
 kasan_report_error mm/kasan/report.c:352 [inline]
 kasan_report.cold.8+0x6d/0x309 mm/kasan/report.c:412
 check_memory_region_inline mm/kasan/kasan.c:260 [inline]
 check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267
 kasan_check_read+0x11/0x20 mm/kasan/kasan.c:272
 atomic_read include/asm-generic/atomic-instrumented.h:21 [inline]
 refcount_sub_and_test_checked+0x9d/0x310 lib/refcount.c:179
 refcount_dec_and_test_checked+0x1a/0x20 lib/refcount.c:212
 vb2_vmalloc_put+0x19/0x80 drivers/media/common/videobuf2/videobuf2-vmalloc.c:68
 __vb2_buf_mem_free+0x112/0x210 drivers/media/common/videobuf2/videobuf2-core.c:242
 __vb2_free_mem drivers/media/common/videobuf2/videobuf2-core.c:413 [inline]
 __vb2_queue_free+0x830/0xa30 drivers/media/common/videobuf2/videobuf2-core.c:458
 vb2_core_queue_release+0x62/0x80 drivers/media/common/videobuf2/videobuf2-core.c:2231
 vb2_queue_release+0x15/0x20 drivers/media/common/videobuf2/videobuf2-v4l2.c:837
 v4l2_m2m_ctx_release+0x2a/0x35 drivers/media/v4l2-core/v4l2-mem2mem.c:931
 vim2m_release+0xe6/0x150 drivers/media/platform/vim2m.c:977
 v4l2_release+0x224/0x3a0 drivers/media/v4l2-core/v4l2-dev.c:456
 __fput+0x385/0xa30 fs/file_table.c:278
 ____fput+0x15/0x20 fs/file_table.c:309
 task_work_run+0x1e8/0x2a0 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0x1ad6/0x26d0 kernel/exit.c:867
 do_group_exit+0x177/0x440 kernel/exit.c:970
 __do_sys_exit_group kernel/exit.c:981 [inline]
 __se_sys_exit_group kernel/exit.c:979 [inline]
 __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:979
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x442cc8
Code: Bad RIP value.
RSP: 002b:00007ffc01263628 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000442cc8
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00000000004c2888 R08: 00000000000000e7 R09: ffffffffffffffd0
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00000000006d4180 R14: 0000000000000000 R15: 0000000000000000
==================================================================

Crashes (31):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/11/05 08:40 upstream 4710e78940d8 8bd6bd63 .config console log report syz C ci-upstream-kasan-gce-smack-root
2018/11/04 12:28 upstream 71e56028173b 8bd6bd63 .config console log report syz C ci-upstream-kasan-gce-selinux-root
2018/11/03 18:16 upstream 5f21585384a4 8bd6bd63 .config console log report syz C ci-upstream-kasan-gce-root
2018/11/03 14:22 upstream 5f21585384a4 8bd6bd63 .config console log report syz C ci-upstream-kasan-gce-smack-root
2018/11/03 05:53 upstream 8adcc59974b8 8bd6bd63 .config console log report syz C ci-upstream-kasan-gce
2018/11/02 01:20 upstream 5b7449810ae6 1f38e9ae .config console log report syz C ci-upstream-kasan-gce
2018/11/02 01:01 upstream 5b7449810ae6 1f38e9ae .config console log report syz C ci-upstream-kasan-gce-root
2018/11/01 11:20 upstream 59fc453b21f7 1f38e9ae .config console log report syz C ci-upstream-kasan-gce-selinux-root
2018/11/03 05:02 upstream 8adcc59974b8 8bd6bd63 .config console log report syz C ci-upstream-kasan-gce-386
2018/11/01 19:49 upstream 5b7449810ae6 1f38e9ae .config console log report syz C ci-upstream-kasan-gce-386
2018/10/05 07:33 net-next-old 2970f2a8e941 8b311eaf .config console log report syz C ci-upstream-net-kasan-gce
2018/11/03 12:01 linux-next 25e9471b6a27 8bd6bd63 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/11/01 18:51 linux-next 4db9d11bcbef 1f38e9ae .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/10/05 18:35 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 18:33 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 16:28 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 13:02 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 12:23 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 12:14 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 10:10 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 07:24 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 07:16 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 07:10 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 07:09 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 07:09 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 07:07 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 07:03 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 07:02 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 06:58 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 06:58 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
2018/10/05 06:54 net-next-old 2970f2a8e941 8b311eaf .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.