syzbot


KASAN: null-ptr-deref Read in __free_pages

Status: fixed on 2023/02/24 13:50
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+d55757faa9b80590767b@syzkaller.appspotmail.com
Fix commit: a635415a064e watch_queue: Fix NULL dereference in error cleanup
First crash: 939d, last: 674d
Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: KASAN: null-ptr-deref Read in __free_pages (log)
Repro: C syz .config
  
Discussions (7)
Title Replies (including bot) Last reply
[PATCH 5.10 000/599] 5.10.110-rc1 review 628 (629) 2022/05/08 12:31
[PATCH 5.16 0000/1017] 5.16.19-rc1 review 1034 (1035) 2022/04/07 08:34
[PATCH 5.15 000/913] 5.15.33-rc1 review 932 (933) 2022/04/06 15:36
[PATCH 5.17 0000/1126] 5.17.2-rc1 review 1143 (1144) 2022/04/06 14:06
[PATCH 0/2] watch_queue: A couple more fixes 5 (5) 2022/03/22 09:55
[syzbot] KASAN: null-ptr-deref Read in __free_pages 10 (16) 2022/03/21 11:30
[PATCH] watch_queue: Free the real number of allocated pages 1 (1) 2022/03/21 01:42
Last patch testing requests (5)
Created Duration User Patch Repo Result
2022/03/21 11:20 8m dhowells@redhat.com git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git 733021c6d8607c5c5ab08bbe9b400d0da609185f OK
2022/03/21 08:24 9m dhowells@redhat.com git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git 6d39b096627f0a1eb6e14f049d8ae3c93e0290f2 OK
2022/03/21 00:28 8m fmdefrancesco@gmail.com patch upstream OK
2022/03/20 23:40 9m fmdefrancesco@gmail.com patch upstream report log
2022/03/20 23:33 4m fmdefrancesco@gmail.com patch upstream error

Sample crash report:
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffc794ecea0 R14: 000000000000000d R15: 00007ff328525490
 </TASK>
==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_read include/linux/instrumented.h:71 [inline]
BUG: KASAN: null-ptr-deref in atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline]
BUG: KASAN: null-ptr-deref in page_ref_count include/linux/page_ref.h:67 [inline]
BUG: KASAN: null-ptr-deref in put_page_testzero include/linux/mm.h:717 [inline]
BUG: KASAN: null-ptr-deref in __free_pages+0x1f/0x1b0 mm/page_alloc.c:5473
Read of size 4 at addr 0000000000000034 by task syz-executor168/3599

CPU: 1 PID: 3599 Comm: syz-executor168 Not tainted 5.17.0-rc8-syzkaller-00003-g56e337f2cf13 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 __kasan_report mm/kasan/report.c:446 [inline]
 kasan_report.cold+0x66/0xdf mm/kasan/report.c:459
 check_region_inline mm/kasan/generic.c:183 [inline]
 kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189
 instrument_atomic_read include/linux/instrumented.h:71 [inline]
 atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline]
 page_ref_count include/linux/page_ref.h:67 [inline]
 put_page_testzero include/linux/mm.h:717 [inline]
 __free_pages+0x1f/0x1b0 mm/page_alloc.c:5473
 watch_queue_set_size+0x499/0x630 kernel/watch_queue.c:275
 pipe_ioctl+0xac/0x2b0 fs/pipe.c:632
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl fs/ioctl.c:860 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7ff3284b2d59
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 31 18 00 00 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 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc794ece38 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000031 RCX: 00007ff3284b2d59
RDX: 0000000000000029 RSI: 0000000000005760 RDI: 0000000000000003
RBP: 00007ffc794ece40 R08: 0000000000000001 R09: 00007ffc794e0035
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffc794ecea0 R14: 000000000000000d R15: 00007ff328525490
 </TASK>
==================================================================

Crashes (21):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/03/16 22:15 upstream 56e337f2cf13 dfa9a8ed .config console log report syz C ci-upstream-kasan-gce KASAN: null-ptr-deref Read in __free_pages
2022/03/19 11:41 upstream 34e047aa16c0 e2d91b1d .config console log report info ci-upstream-kasan-gce-selinux-root KASAN: null-ptr-deref Read in __free_pages
2022/03/16 22:15 upstream 56e337f2cf13 dfa9a8ed .config console log report info ci-upstream-kasan-gce-root KASAN: null-ptr-deref Read in __free_pages
2022/03/16 22:01 upstream 56e337f2cf13 dfa9a8ed .config console log report info ci-upstream-kasan-gce KASAN: null-ptr-deref Read in __free_pages
2022/03/19 18:06 upstream 34e047aa16c0 e2d91b1d .config console log report info ci-qemu2-arm64 KASAN: null-ptr-deref Read in __free_pages
2022/03/18 12:30 upstream 551acdc3c3d2 e2d91b1d .config console log report info ci-qemu2-arm64 KASAN: null-ptr-deref Read in __free_pages
2022/03/18 12:00 upstream 551acdc3c3d2 e2d91b1d .config console log report info ci-qemu2-arm64 KASAN: null-ptr-deref Read in __free_pages
2022/12/07 12:10 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 0966d385830d d88f3abb .config console log report info ci-qemu2-riscv64 KASAN: null-ptr-deref Read in __free_pages
2022/11/28 00:44 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 0966d385830d f4470a7b .config console log report info ci-qemu2-riscv64 KASAN: null-ptr-deref Read in __free_pages
2022/10/02 18:11 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 0966d385830d feb56351 .config console log report info ci-qemu2-riscv64 KASAN: null-ptr-deref Read in __free_pages
2022/09/25 01:37 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 0966d385830d 0042f2b4 .config console log report info ci-qemu2-riscv64 KASAN: null-ptr-deref Read in __free_pages
2022/05/17 13:07 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 0966d385830d 744a39e2 .config console log report info ci-qemu2-riscv64 KASAN: null-ptr-deref Read in __free_pages
2022/03/27 21:57 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 0966d385830d 89bc8608 .config console log report info ci-qemu2-riscv64 KASAN: null-ptr-deref Read in __free_pages
2022/03/21 03:20 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 0966d385830d e2d91b1d .config console log report info ci-qemu2-riscv64 KASAN: null-ptr-deref Read in __free_pages
2022/03/19 13:32 upstream 34e047aa16c0 e2d91b1d .config console log report info ci-qemu2-arm32 BUG: unable to handle kernel NULL pointer dereference in __free_pages
2022/03/19 06:25 upstream 34e047aa16c0 e2d91b1d .config console log report info ci-qemu2-arm32 BUG: unable to handle kernel NULL pointer dereference in __free_pages
2022/03/18 04:52 upstream 551acdc3c3d2 e2d91b1d .config console log report info ci-qemu2-arm32 BUG: unable to handle kernel NULL pointer dereference in __free_pages
2022/03/17 02:12 upstream 56e337f2cf13 46cc3b21 .config console log report info ci-qemu2-arm32 BUG: unable to handle kernel NULL pointer dereference in __free_pages
2022/03/17 00:09 upstream 56e337f2cf13 46cc3b21 .config console log report info ci-qemu2-arm32 BUG: unable to handle kernel NULL pointer dereference in __free_pages
2022/03/16 23:50 upstream 56e337f2cf13 46cc3b21 .config console log report info ci-qemu2-arm32 BUG: unable to handle kernel NULL pointer dereference in __free_pages
2022/03/16 22:28 upstream 56e337f2cf13 46cc3b21 .config console log report info ci-qemu2-arm32 BUG: unable to handle kernel NULL pointer dereference in __free_pages
* Struck through repros no longer work on HEAD.