syzbot


KASAN: null-ptr-deref Read in css_task_iter_advance

Status: fixed on 2019/07/10 21:40
Subsystems: cgroups
[Documentation on labels]
Reported-by: syzbot+d4bba5ccd4f9a2a68681@syzkaller.appspotmail.com
Fix commit: c596687a008b cgroup: Fix css_task_iter_advance_css_set() cset skip condition
First crash: 1944d, last: 1943d
Discussions (3)
Title Replies (including bot) Last reply
[PATCH 4.14 00/33] 4.14.138-stable review 50 (50) 2019/09/01 00:07
[PATCH 4.19 00/45] 4.19.66-stable review 51 (51) 2019/08/11 06:17
KASAN: null-ptr-deref Read in css_task_iter_advance 1 (2) 2019/06/10 18:19

Sample crash report:
==================================================================
BUG: KASAN: null-ptr-deref in atomic_read include/asm-generic/atomic-instrumented.h:26 [inline]
BUG: KASAN: null-ptr-deref in css_task_iter_advance+0x240/0x540 kernel/cgroup/cgroup.c:4503
Read of size 4 at addr 0000000000000004 by task syz-executor.1/13411

CPU: 0 PID: 13411 Comm: syz-executor.1 Not tainted 5.2.0-rc3-next-20190607 #11
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+0x172/0x1f0 lib/dump_stack.c:113
 __kasan_report.cold+0x5/0x36 mm/kasan/report.c:486
 kasan_report+0x12/0x20 mm/kasan/common.c:614
 check_memory_region_inline mm/kasan/generic.c:185 [inline]
 check_memory_region+0x123/0x190 mm/kasan/generic.c:191
 kasan_check_read+0x11/0x20 mm/kasan/common.c:94
 atomic_read include/asm-generic/atomic-instrumented.h:26 [inline]
 css_task_iter_advance+0x240/0x540 kernel/cgroup/cgroup.c:4503
 css_task_iter_start+0x18b/0x230 kernel/cgroup/cgroup.c:4543
 __cgroup_procs_start.isra.0+0x32f/0x400 kernel/cgroup/cgroup.c:4638
 cgroup_procs_start kernel/cgroup/cgroup.c:4660 [inline]
 cgroup_procs_start+0x1e7/0x260 kernel/cgroup/cgroup.c:4647
 cgroup_seqfile_start+0xa4/0xd0 kernel/cgroup/cgroup.c:3752
 kernfs_seq_start+0xdc/0x190 fs/kernfs/file.c:118
 seq_read+0x2a7/0x1110 fs/seq_file.c:224
 kernfs_fop_read+0xed/0x560 fs/kernfs/file.c:252
 do_loop_readv_writev fs/read_write.c:714 [inline]
 do_loop_readv_writev fs/read_write.c:701 [inline]
 do_iter_read+0x4a4/0x660 fs/read_write.c:935
 vfs_readv+0xf0/0x160 fs/read_write.c:997
 kernel_readv fs/splice.c:359 [inline]
 default_file_splice_read+0x475/0x890 fs/splice.c:414
 do_splice_to+0x127/0x180 fs/splice.c:877
 splice_direct_to_actor+0x2d2/0x970 fs/splice.c:954
 do_splice_direct+0x1da/0x2a0 fs/splice.c:1063
 do_sendfile+0x597/0xd00 fs/read_write.c:1464
 __do_sys_sendfile64 fs/read_write.c:1525 [inline]
 __se_sys_sendfile64 fs/read_write.c:1511 [inline]
 __x64_sys_sendfile64+0x1dd/0x220 fs/read_write.c:1511
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x459279
Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f8a49dc9c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000459279
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000004
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000002 R11: 0000000000000246 R12: 00007f8a49dca6d4
R13: 00000000004c6835 R14: 00000000004db7a8 R15: 00000000ffffffff
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/10 17:37 linux-next 3f310e51ceb1 0159583c .config console log report ci-upstream-linux-next-kasan-gce-root
2019/06/10 02:15 linux-next 3f310e51ceb1 0159583c .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.