syzbot


panic: runtime error: slice bounds out of range [12:LINE]

Status: fixed on 2023/11/17 13:01
Reported-by: syzbot+4c8983831b3b9c7feff6@syzkaller.appspotmail.com
Fix commit: c96439ecd0b4 devpts: IterDirents has to check offset and return if it is out of range
First crash: 1378d, last: 376d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
gvisor panic: runtime error: slice bounds out of range [2:LINE] 1 1224d 1224d 14/26 fixed on 2021/08/16 21:45
gvisor panic: runtime error: slice bounds out of range [40:LINE] 3 1212d 1215d 14/26 fixed on 2021/09/25 08:25
gvisor panic: runtime error: slice bounds out of range [NUM:NUM] C 666 111d 123d 0/26 moderation: reported C repro on 2024/07/26 06:51

Sample crash report:
panic: runtime error: slice bounds out of range [124:0]

goroutine 136 [running]:
panic({0x3ef9e0?, 0xc000848b28?})
	GOROOT/src/runtime/panic.go:1017 +0x3ac fp=0xc000a70a60 sp=0xc000a709b0 pc=0x121f2ec
runtime.goPanicSliceB(0x7c, 0x0)
	GOROOT/src/runtime/panic.go:154 +0x7c fp=0xc000a70aa0 sp=0xc000a70a60 pc=0x121d6dc
gvisor.dev/gvisor/pkg/sentry/fsimpl/devpts.(*rootInode).IterDirents(0xc00063b000, {0x726a98, 0xc0003f3500}, 0x31ce60?, {0x708900, 0xc000a74340}, 0x7f, 0x7c)
	pkg/sentry/fsimpl/devpts/devpts.go:342 +0x64f fp=0xc000a70ca0 sp=0xc000a70aa0 pc=0x22bd38f
gvisor.dev/gvisor/pkg/sentry/fsimpl/kernfs.(*GenericDirectoryFD).IterDirents(0xc0008823f0, {0x726a98, 0xc0003f3500}, {0x708900?, 0xc000a74340?})
	pkg/sentry/fsimpl/kernfs/fd_impl_util.go:224 +0xd83 fp=0xc000a71270 sp=0xc000a70ca0 pc=0x18c1003
gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescription).IterDirents(0xc000882400, {0x726a98, 0xc0003f3500}, {0x708900, 0xc000a74340})
	pkg/sentry/vfs/file_description.go:691 +0x15e fp=0xc000a71328 sp=0xc000a71270 pc=0x17e37be
gvisor.dev/gvisor/pkg/sentry/syscalls/linux.getdents(0xc0003f3500, {{0x3}, {0x20000080}, {0x1f}, {0x7ffa6c9d5be0}, {0x7ffa6c9d5be0}, {0x7ffa6c9d5be0}}, 0x98?)
	pkg/sentry/syscalls/linux/sys_getdents.go:68 +0x273 fp=0xc000a71458 sp=0xc000a71328 pc=0x1e2a1f3
gvisor.dev/gvisor/pkg/sentry/syscalls/linux.Getdents64(0xc000a71540?, 0x125292e?, {{0x3}, {0x20000080}, {0x1f}, {0x7ffa6c9d5be0}, {0x7ffa6c9d5be0}, {0x7ffa6c9d5be0}})
	pkg/sentry/syscalls/linux/sys_getdents.go:36 +0x68 fp=0xc000a714d0 sp=0xc000a71458 pc=0x1e29f28
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall(0xc0003f3500, 0xd9, {{0x3}, {0x20000080}, {0x1f}, {0x7ffa6c9d5be0}, {0x7ffa6c9d5be0}, {0x7ffa6c9d5be0}})
	pkg/sentry/kernel/task_syscall.go:142 +0xaff fp=0xc000a71908 sp=0xc000a714d0 pc=0x1bfd43f
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke(0xc0003f3500, 0x1?, {{0x3}, {0x20000080}, {0x1f}, {0x7ffa6c9d5be0}, {0x7ffa6c9d5be0}, {0x7ffa6c9d5be0}})
	pkg/sentry/kernel/task_syscall.go:322 +0x7d fp=0xc000a719c0 sp=0xc000a71908 pc=0x1bff4fd
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter(0xc000b220f0?, 0x125b4e9?, {{0x3}, {0x20000080}, {0x1f}, {0x7ffa6c9d5be0}, {0x7ffa6c9d5be0}, {0x7ffa6c9d5be0}})
	pkg/sentry/kernel/task_syscall.go:282 +0xbd fp=0xc000a71a38 sp=0xc000a719c0 pc=0x1bfedfd
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall(0xc0003f3500)
	pkg/sentry/kernel/task_syscall.go:257 +0x55b fp=0xc000a71b70 sp=0xc000a71a38 pc=0x1bfe95b
gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute(0xc0003f3500?, 0xc0003f3500)
	pkg/sentry/kernel/task_run.go:269 +0x2387 fp=0xc000a71e60 sp=0xc000a71b70 pc=0x1be7847
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run(0xc0003f3500, 0x9)
	pkg/sentry/kernel/task_run.go:98 +0x36a fp=0xc000a71fb0 sp=0xc000a71e60 pc=0x1be4baa
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start.func1()
	pkg/sentry/kernel/task_start.go:391 +0x45 fp=0xc000a71fe0 sp=0xc000a71fb0 pc=0x1bfaca5
runtime.goexit()
	src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000a71fe8 sp=0xc000a71fe0 pc=0x1258301
created by gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start in goroutine 120
	pkg/sentry/kernel/task_start.go:391 +0x1ce

Crashes (63):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/11/14 03:11 gvisor 8c52800156e2 cb976f63 .config console log report syz C ci-gvisor-ptrace-3-race-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 03:01 gvisor 8c52800156e2 cb976f63 .config console log report syz C ci-gvisor-ptrace-1-race-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 03:01 gvisor 8c52800156e2 cb976f63 .config console log report syz C ci-gvisor-ptrace-2-race-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 03:01 gvisor 8c52800156e2 cb976f63 .config console log report syz C ci-gvisor-systrap-1-race-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 03:00 gvisor 8c52800156e2 cb976f63 .config console log report syz C ci-gvisor-ptrace-3-race panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:59 gvisor 8c52800156e2 cb976f63 console log report syz C ci-gvisor-ptrace-3 panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:59 gvisor 8c52800156e2 cb976f63 .config console log report syz C ci-gvisor-ptrace-3-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:50 gvisor 8c52800156e2 cb976f63 .config console log report syz C ci-gvisor-ptrace-2-race panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:50 gvisor 8c52800156e2 cb976f63 console log report syz C ci-gvisor-ptrace-2 panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:50 gvisor 8c52800156e2 cb976f63 .config console log report syz C ci-gvisor-ptrace-2-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:50 gvisor 8c52800156e2 cb976f63 console log report syz C ci-gvisor-ptrace-1 panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:50 gvisor 8c52800156e2 cb976f63 console log report syz C ci-gvisor-kvm panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:50 gvisor 8c52800156e2 cb976f63 console log report syz C ci-gvisor-systrap-1 panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:50 gvisor 8c52800156e2 cb976f63 .config console log report syz C ci-gvisor-ptrace-1-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:49 gvisor 8c52800156e2 cb976f63 .config console log report syz C ci-gvisor-systrap-1-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:49 gvisor 8c52800156e2 cb976f63 .config console log report syz C ci-gvisor-kvm-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:49 gvisor 8c52800156e2 cb976f63 .config console log report syz C ci-gvisor-ptrace-1-race panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:49 gvisor 8c52800156e2 cb976f63 .config console log report syz C ci-gvisor-systrap-1-race panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:47 gvisor 8c52800156e2 cb976f63 console log report syz C ci-gvisor-arm64-systrap-1 panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:47 gvisor 8c52800156e2 cb976f63 .config console log report syz C ci-gvisor-arm64-ptrace-1-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:47 gvisor 8c52800156e2 cb976f63 console log report syz C ci-gvisor-arm64-ptrace-1 panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:37 gvisor 8c52800156e2 cb976f63 .config console log report syz C ci-gvisor-arm64-systrap-1-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2021/09/04 04:36 gvisor 775a321120f0 d236a457 .config console log report syz C ci-gvisor-kvm panic: runtime error: slice bounds out of range [NUM:NUM]
2021/02/17 05:41 gvisor ba51999fa65d 98682e5e .config console log report syz ci-gvisor-kvm panic: runtime error: slice bounds out of range [12:LINE]
2021/02/17 05:01 gvisor 3ef012944d32 98682e5e .config console log report syz ci-gvisor-ptrace-2 panic: runtime error: slice bounds out of range [12:LINE]
2021/02/17 04:56 gvisor 3ef012944d32 98682e5e .config console log report syz ci-gvisor-kvm-cover panic: runtime error: slice bounds out of range [12:LINE]
2021/02/17 04:55 gvisor 3ef012944d32 98682e5e .config console log report syz ci-gvisor-ptrace-1-cover panic: runtime error: slice bounds out of range [12:LINE]
2021/02/17 04:36 gvisor 3ef012944d32 98682e5e .config console log report syz ci-gvisor-ptrace-2-cover panic: runtime error: slice bounds out of range [12:LINE]
2022/01/07 19:42 gvisor f2a57c9dac27 2ca0d385 .config console log report syz ci-gvisor-ptrace-1 panic: runtime error: slice bounds out of range [NUM:NUM]
2022/01/07 19:37 gvisor f2a57c9dac27 2ca0d385 .config console log report syz ci-gvisor-ptrace-2-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2021/02/17 04:15 gvisor 3ef012944d32 98682e5e .config console log report info ci-gvisor-ptrace-2-cover panic: runtime error: slice bounds out of range [12:LINE]
2023/11/15 18:08 gvisor 3ab01aedb874 cb976f63 .config console log report info ci-gvisor-arm64-ptrace-1-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2023/11/14 02:27 gvisor 8c52800156e2 cb976f63 .config console log report info ci-gvisor-arm64-systrap-1-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/05 03:52 gvisor 518535de9b0e e13a05ed .config console log report info ci-gvisor-ptrace-2 panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/04 20:37 gvisor dce4528a1a95 a3e470b2 .config console log report info ci-gvisor-ptrace-3 panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/04 19:02 gvisor dce4528a1a95 a3e470b2 .config console log report info ci-gvisor-ptrace-2 panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/04 17:37 gvisor dce4528a1a95 a3e470b2 .config console log report info ci-gvisor-ptrace-3 panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/04 06:49 gvisor 95d883a92e31 30646bfe .config console log report info ci-gvisor-ptrace-1 panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/03 23:26 gvisor 95d883a92e31 30646bfe .config console log report info ci-gvisor-ptrace-2-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/03 13:47 gvisor a5ce865145c7 4ebb2798 .config console log report info ci-gvisor-ptrace-3-race panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/03 12:28 gvisor a5ce865145c7 4ebb2798 .config console log report info ci-gvisor-kvm panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/03 10:14 gvisor a5ce865145c7 4ebb2798 .config console log report info ci-gvisor-ptrace-1-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/02 19:23 gvisor bcba5136d0d0 4ebb2798 .config console log report info ci-gvisor-ptrace-3-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/02 18:49 gvisor bcba5136d0d0 4ebb2798 .config console log report info ci-gvisor-ptrace-1 panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/02 18:20 gvisor bcba5136d0d0 4ebb2798 .config console log report info ci-gvisor-ptrace-3 panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/02 07:55 gvisor 5a642df6b326 4ebb2798 .config console log report info ci-gvisor-kvm panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/02 03:38 gvisor 5a642df6b326 4ebb2798 .config console log report info ci-gvisor-kvm-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/02 03:26 gvisor 5a642df6b326 4ebb2798 .config console log report info ci-gvisor-ptrace-1 panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/01 19:50 gvisor 0f8db423e270 c1c1631d .config console log report info ci-gvisor-kvm-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/01 14:51 gvisor 0f8db423e270 c1c1631d .config console log report info ci-gvisor-ptrace-3-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2022/02/01 05:39 gvisor 5ef032d4df28 6b7c57fe .config console log report info ci-gvisor-ptrace-2 panic: runtime error: slice bounds out of range [NUM:NUM]
2022/01/31 19:30 gvisor 2a3d59997fb9 a491ad2d .config console log report info ci-gvisor-kvm panic: runtime error: slice bounds out of range [NUM:NUM]
2022/01/31 15:28 gvisor 2a3d59997fb9 a491ad2d .config console log report info ci-gvisor-kvm panic: runtime error: slice bounds out of range [NUM:NUM]
2022/01/31 09:35 gvisor 2a3d59997fb9 a491ad2d .config console log report info ci-gvisor-ptrace-2 panic: runtime error: slice bounds out of range [NUM:NUM]
2022/01/31 05:14 gvisor 2a3d59997fb9 495e00c5 .config console log report info ci-gvisor-kvm panic: runtime error: slice bounds out of range [NUM:NUM]
2022/01/31 01:45 gvisor 2a3d59997fb9 495e00c5 .config console log report info ci-gvisor-kvm panic: runtime error: slice bounds out of range [NUM:NUM]
2022/01/30 23:31 gvisor 2a3d59997fb9 495e00c5 .config console log report info ci-gvisor-kvm panic: runtime error: slice bounds out of range [NUM:NUM]
2022/01/30 04:15 gvisor 2a3d59997fb9 495e00c5 .config console log report info ci-gvisor-kvm-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2022/01/30 03:27 gvisor 2a3d59997fb9 495e00c5 .config console log report info ci-gvisor-ptrace-1-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2022/01/29 11:20 gvisor 2a3d59997fb9 495e00c5 .config console log report info ci-gvisor-ptrace-3-cover panic: runtime error: slice bounds out of range [NUM:NUM]
2022/01/29 00:56 gvisor e98016263b1e 495e00c5 .config console log report info ci-gvisor-kvm panic: runtime error: slice bounds out of range [NUM:NUM]
2022/01/28 16:04 gvisor 2083e858ad8d 495e00c5 .config console log report info ci-gvisor-ptrace-1 panic: runtime error: slice bounds out of range [NUM:NUM]
2022/01/12 23:02 gvisor f2a57c9dac27 44d1319a .config console log report info ci-gvisor-kvm-cover panic: runtime error: slice bounds out of range [NUM:NUM]
* Struck through repros no longer work on HEAD.