syzbot


BUG: corrupted list in ptp_open

Status: fixed on 2023/12/21 03:45
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+df3f3ef31f60781fa911@syzkaller.appspotmail.com
Fix commit: 1bea2c3e6df8 ptp: fix corrupted list in ptp_open b714ca2ccf6a ptp: ptp_read should not release queue
First crash: 406d, last: 392d
Cause bisection: introduced by (bisect log) :
commit 8f5de6fb245326704f37d91780b9a10253a8a100
Author: Xabier Marquiegui <reibax@gmail.com>
Date: Wed Oct 11 22:39:55 2023 +0000

  ptp: support multiple timestamp event readers

Crash: BUG: corrupted list in ptp_open (log)
Repro: C syz .config
  
Discussions (20)
Title Replies (including bot) Last reply
[PATCH net V9 1/2] ptp: ptp_read should not release queue 2 (2) 2023/11/09 02:50
[PATCH net V9 2/2] ptp: fix corrupted list in ptp_open 1 (1) 2023/11/07 08:00
[PATCH net-next V8 2/2] ptp: fix corrupted list in ptp_open 2 (2) 2023/11/07 06:13
[PATCH net-next V8 1/2] ptp: ptp_read should not release queue 2 (2) 2023/11/07 06:13
Re: [syzbot] [PATCH] Test for 2030579113a1 0 (1) 2023/11/06 13:58
[PATCH net-next V7 2/2] ptp: ptp_read should not release queue 1 (1) 2023/11/06 13:41
[PATCH net-next V7 1/2] ptp: fix corrupted list in ptp_open 1 (1) 2023/11/06 13:41
Re: [syzbot] [PATCH] Test for 2030579113a1 0 (1) 2023/11/06 11:37
Re: [syzbot] [PATCH] Test for 2030579113a1 0 (1) 2023/11/06 11:05
[PATCH net-next V6] ptp: fix corrupted list in ptp_open 3 (3) 2023/11/05 14:02
Re: [syzbot] [PATCH] Test for 2030579113a1 0 (1) 2023/11/05 01:44
Re: [syzbot] [PATCH] Test for 2030579113a1 0 (1) 2023/11/05 01:27
[PATCH net-next V5] ptp: fix corrupted list in ptp_open 2 (2) 2023/11/04 15:20
[PATCH net-next V4] ptp: fix corrupted list in ptp_open 2 (2) 2023/11/04 06:20
Re: [syzbot] [PATCH] Test for 2030579113a1 0 (1) 2023/11/04 02:43
[PATCH net-next V2] ptp: fix corrupted list in ptp_open 6 (6) 2023/11/04 02:15
[PATCH net-next V3] ptp: fix corrupted list in ptp_open 5 (5) 2023/11/04 02:08
[PATCH net-next] ptp: ptp_read should not release queue 11 (11) 2023/11/03 23:15
Re: [syzbot] [PATCH] Test for 2030579113a1 0 (1) 2023/11/03 11:29
[syzbot] [net?] BUG: corrupted list in ptp_open 0 (1) 2023/10/26 14:20
Last patch testing requests (23)
Created Duration User Patch Repo Result
2023/11/06 13:58 41m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d OK log
2023/11/06 11:37 1h10m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d OK log
2023/11/06 11:05 58m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d OK log
2023/11/05 01:44 21m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d OK log
2023/11/05 01:27 6m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d error
2023/11/04 02:43 20m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d OK log
2023/11/03 11:29 25m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d OK log
2023/10/30 11:07 48m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d OK log
2023/10/30 11:27 36m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d OK log
2023/10/28 11:33 22m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2030579113a1 OK log
2023/10/28 07:10 16m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2030579113a1 report log
2023/10/28 04:19 22m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d OK log
2023/10/28 03:07 13m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d error
2023/10/28 01:19 16m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2030579113a1 report log
2023/10/27 09:52 15m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d report log
2023/10/27 08:53 17m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d report log
2023/10/27 07:28 18m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d report log
2023/10/27 06:43 20m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d report log
2023/10/27 05:37 29m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d report log
2023/10/27 03:53 16m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d report log
2023/10/27 03:29 15m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d report log
2023/10/27 01:28 17m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d report log
2023/10/27 00:11 46m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2dac75696c6d report log

Sample crash report:
list_add corruption. next->prev should be prev (ffff888021195048), but was ffff88807a6ed048. (next=ffff88814a7965e8).
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:31!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 5198 Comm: syz-executor231 Not tainted 6.6.0-syzkaller-10396-g4652b8e4f3ff #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
RIP: 0010:__list_add_valid_or_report+0xce/0xf0 lib/list_debug.c:29
Code: 5d 9d 8b e8 64 d1 87 06 0f 0b 48 c7 c7 40 5e 9d 8b e8 56 d1 87 06 0f 0b 48 c7 c7 a0 5e 9d 8b 4c 89 e6 4c 89 f1 e8 42 d1 87 06 <0f> 0b 48 c7 c7 20 5f 9d 8b 4c 89 f6 4c 89 e1 e8 2e d1 87 06 0f 0b
RSP: 0018:ffffc90003c77650 EFLAGS: 00010246
RAX: 0000000000000075 RBX: ffff88814a7965f0 RCX: 319ab293341e1500
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffffc90003c77778 R08: ffffffff81717e2c R09: 1ffff9200078ee68
R10: dffffc0000000000 R11: fffff5200078ee69 R12: ffff888021195048
R13: dffffc0000000000 R14: ffff88814a7965e8 R15: ffff88801d711048
FS:  00007fc73b6496c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000008 CR3: 00000000735d1000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __list_add_valid include/linux/list.h:88 [inline]
 __list_add include/linux/list.h:150 [inline]
 list_add_tail include/linux/list.h:183 [inline]
 ptp_open+0x1af/0x430 drivers/ptp/ptp_chardev.c:122
 posix_clock_open+0x155/0x1f0 kernel/time/posix-clock.c:134
 chrdev_open+0x5ab/0x630 fs/char_dev.c:414
 do_dentry_open+0x8fd/0x1590 fs/open.c:948
 do_open fs/namei.c:3622 [inline]
 path_openat+0x2845/0x3280 fs/namei.c:3779
 do_filp_open+0x234/0x490 fs/namei.c:3809
 do_sys_openat2+0x13e/0x1d0 fs/open.c:1440
 do_sys_open fs/open.c:1455 [inline]
 __do_sys_openat fs/open.c:1471 [inline]
 __se_sys_openat fs/open.c:1466 [inline]
 __x64_sys_openat+0x247/0x290 fs/open.c:1466
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7fc73b6882a9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc73b649238 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007fc73b712308 RCX: 00007fc73b6882a9
RDX: 0000000000000000 RSI: 0000000020000000 RDI: ffffffffffffff9c
RBP: 00007fc73b712300 R08: 00007ffd566ead47 R09: 00007fc73b6496c0
R10: 0000000000000000 R11: 0000000000000246 R12: 7074702f7665642f
R13: 0000000000000000 R14: 00007ffd566eac60 R15: 00007ffd566ead48
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__list_add_valid_or_report+0xce/0xf0 lib/list_debug.c:29
Code: 5d 9d 8b e8 64 d1 87 06 0f 0b 48 c7 c7 40 5e 9d 8b e8 56 d1 87 06 0f 0b 48 c7 c7 a0 5e 9d 8b 4c 89 e6 4c 89 f1 e8 42 d1 87 06 <0f> 0b 48 c7 c7 20 5f 9d 8b 4c 89 f6 4c 89 e1 e8 2e d1 87 06 0f 0b
RSP: 0018:ffffc90003c77650 EFLAGS: 00010246
RAX: 0000000000000075 RBX: ffff88814a7965f0 RCX: 319ab293341e1500
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffffc90003c77778 R08: ffffffff81717e2c R09: 1ffff9200078ee68
R10: dffffc0000000000 R11: fffff5200078ee69 R12: ffff888021195048
R13: dffffc0000000000 R14: ffff88814a7965e8 R15: ffff88801d711048
FS:  00007fc73b6496c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000008 CR3: 00000000735d1000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/11/03 05:23 upstream 4652b8e4f3ff c4ac074c .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: corrupted list in ptp_open
2023/10/22 14:18 linux-next 2030579113a1 361b23dc .config console log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: corrupted list in ptp_open
2023/11/01 21:48 linux-next fa7d0c172786 69904c9f .config console log report syz [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: corrupted list in ptp_open
2023/11/05 03:43 upstream aea6bf908d73 500bfdc4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: corrupted list in ptp_open
2023/11/04 04:02 upstream 8f6f76a6a29f 500bfdc4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce BUG: corrupted list in ptp_open
2023/11/02 16:36 upstream babe393974de 69904c9f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: corrupted list in ptp_open
2023/11/05 01:50 upstream 90b0c2b2edd1 500bfdc4 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 BUG: corrupted list in ptp_open
* Struck through repros no longer work on HEAD.