syzbot


panic: invalid allocation length: 0x0 (4)

Status: fixed on 2022/06/09 07:46
Fix commit: 3290a054c5bd getdents: Test that size parameter is not zero before allocating PMAs.
First crash: 903d, last: 901d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
gvisor panic: invalid allocation length: 0x0 (3) syz 12 1764d 1764d 0/26 fixed on 2020/01/31 18:49
gvisor panic: invalid allocation length: 0x0 C 223 2181d 2348d 0/26 fixed on 2018/12/12 09:36
gvisor panic: invalid allocation length: 0x0 (2) C 4 2170d 2171d 0/26 fixed on 2018/12/19 10:45

Sample crash report:
panic: invalid allocation length: 0x0

goroutine 227 [running]:
panic({0xfe7060, 0xc0005b6020})
	GOROOT/src/runtime/panic.go:1147 +0x3a8 fp=0xc000db5090 sp=0xc000db4fd0 pc=0x435148
gvisor.dev/gvisor/pkg/sentry/pgalloc.(*MemoryFile).Allocate(0xc000c4f878, 0xc0000e2280, {0x8d7a00, 0xc000776c50})
	pkg/sentry/pgalloc/pgalloc.go:417 +0x545 fp=0xc000db51a0 sp=0xc000db5090 pc=0x7d28e5
gvisor.dev/gvisor/pkg/sentry/mm.(*MemoryManager).getPMAsInternalLocked(0xc000c4f000, {0x1394d10, 0xc000c78000}, {0xc000c4f080, 0x8975a7}, {0x8d7527, 0xc00039a4e0}, {0x0, 0x1, 0x0})
	pkg/sentry/mm/pma.go:243 +0x1746 fp=0xc000db55c8 sp=0xc000db51a0 pc=0x880046
gvisor.dev/gvisor/pkg/sentry/mm.(*MemoryManager).getPMAsLocked(0xc000776000, {0x1394d10, 0xc000c78000}, {0xc000c4f080, 0xc000db56a0}, {0xcb3b8a, 0xc000db57b0}, {0x0, 0x1, 0x0})
	pkg/sentry/mm/pma.go:125 +0xbf fp=0xc000db5658 sp=0xc000db55c8 pc=0x87e31f
gvisor.dev/gvisor/pkg/sentry/mm.(*MemoryManager).withInternalMappings(0xc000c4f000, {0x1394d10, 0xc000c78000}, {0x0, 0x0}, {0x0, 0x46, 0xc1}, 0x0, 0x1214c68)
	pkg/sentry/mm/io.go:542 +0x2e5 fp=0xc000db5748 sp=0xc000db5658 pc=0x879505
gvisor.dev/gvisor/pkg/sentry/mm.(*MemoryManager).EnsurePMAsExist(0xcb3b00, {0x1394d10, 0xc000c78000}, 0xc0000e2280, 0xc00039a2a0, {0x0, 0x12})
	pkg/sentry/mm/io.go:322 +0x77 fp=0xc000db5790 sp=0xc000db5748 pc=0x878377
gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.getdents(0xc000c78000, {{0x3}, {0x0}, {0x0}, {0x0}, {0x0}, {0x0}}, 0x0)
	pkg/sentry/syscalls/linux/vfs2/getdents.go:53 +0x131 fp=0xc000db5858 sp=0xc000db5790 pc=0xcb6a51
gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.Getdents(0xc000051800, {{0x3}, {0x0}, {0x0}, {0x0}, {0x0}, {0x0}})
	pkg/sentry/syscalls/linux/vfs2/getdents.go:31 +0x38 fp=0xc000db58a8 sp=0xc000db5858 pc=0xcb6898
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall(0xc000c78000, 0x4e, {{0x3}, {0x0}, {0x0}, {0x0}, {0x0}, {0x0}})
	pkg/sentry/kernel/task_syscall.go:142 +0x825 fp=0xc000db5cb0 sp=0xc000db58a8 pc=0x9ba365
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke(0xc000c78000, 0x0, {{0x3}, {0x0}, {0x0}, {0x0}, {0x0}, {0x0}})
	pkg/sentry/kernel/task_syscall.go:322 +0x4d fp=0xc000db5d20 sp=0xc000db5cb0 pc=0x9bb68d
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter(0xc000c5e0b8, 0x1394d10, {{0x3}, {0x0}, {0x0}, {0x0}, {0x0}, {0x0}})
	pkg/sentry/kernel/task_syscall.go:282 +0x65 fp=0xc000db5d80 sp=0xc000db5d20 pc=0x9bb345
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall(0xc000c78000)
	pkg/sentry/kernel/task_syscall.go:257 +0x31a fp=0xc000db5e48 sp=0xc000db5d80 pc=0x9bb07a
gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute(0xc000d9c080, 0xc000c78000)
	pkg/sentry/kernel/task_run.go:247 +0xe45 fp=0xc000db5f70 sp=0xc000db5e48 pc=0x9af145
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run(0xc000c78000)
	pkg/sentry/kernel/task_run.go:90 +0x1a2 fp=0xc000db5fc8 sp=0xc000db5f70 pc=0x9adca2
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start·dwrap·239()
	pkg/sentry/kernel/task_start.go:364 +0x26 fp=0xc000db5fe0 sp=0xc000db5fc8 pc=0x9b8ac6
runtime.goexit()
	src/runtime/asm_amd64.s:1581 +0x1 fp=0xc000db5fe8 sp=0xc000db5fe0 pc=0x4692a1
created by gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start
	pkg/sentry/kernel/task_start.go:364 +0xe7

Crashes (4338):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/06/06 20:01 gvisor f13e23932ba1 c8857892 .config console log report syz C ci-gvisor-kvm panic: invalid allocation length: 0x0
2022/06/09 07:19 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-1-cover panic: invalid allocation length: 0x0
2022/06/09 06:55 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-2-race panic: invalid allocation length: 0x0
2022/06/09 06:47 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-1-race panic: invalid allocation length: 0x0
2022/06/09 06:38 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3-cover panic: invalid allocation length: 0x0
2022/06/09 06:33 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3-cover panic: invalid allocation length: 0x0
2022/06/09 06:27 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-1-cover panic: invalid allocation length: 0x0
2022/06/09 06:12 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3-cover panic: invalid allocation length: 0x0
2022/06/09 06:05 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-kvm panic: invalid allocation length: 0x0
2022/06/09 06:01 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3 panic: invalid allocation length: 0x0
2022/06/09 05:31 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3 panic: invalid allocation length: 0x0
2022/06/09 05:21 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-2-race panic: invalid allocation length: 0x0
2022/06/09 05:05 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-1-cover panic: invalid allocation length: 0x0
2022/06/09 05:01 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3 panic: invalid allocation length: 0x0
2022/06/09 04:58 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3-race panic: invalid allocation length: 0x0
2022/06/09 04:42 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3 panic: invalid allocation length: 0x0
2022/06/09 04:30 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-2-cover panic: invalid allocation length: 0x0
2022/06/09 04:13 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-1-cover panic: invalid allocation length: 0x0
2022/06/09 03:35 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-2 panic: invalid allocation length: 0x0
2022/06/09 03:20 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-kvm-cover panic: invalid allocation length: 0x0
2022/06/09 03:13 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3-race panic: invalid allocation length: 0x0
2022/06/09 02:52 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3 panic: invalid allocation length: 0x0
2022/06/09 02:44 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-1 panic: invalid allocation length: 0x0
2022/06/09 02:41 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-2-race panic: invalid allocation length: 0x0
2022/06/09 02:29 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-kvm-cover panic: invalid allocation length: 0x0
2022/06/09 02:17 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-kvm panic: invalid allocation length: 0x0
2022/06/09 01:52 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-2-cover panic: invalid allocation length: 0x0
2022/06/09 01:34 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-kvm-cover panic: invalid allocation length: 0x0
2022/06/09 01:05 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3 panic: invalid allocation length: 0x0
2022/06/09 00:38 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-2 panic: invalid allocation length: 0x0
2022/06/09 00:23 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-1-cover panic: invalid allocation length: 0x0
2022/06/09 00:15 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-kvm panic: invalid allocation length: 0x0
2022/06/08 23:55 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3-cover panic: invalid allocation length: 0x0
2022/06/08 23:44 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-1-cover panic: invalid allocation length: 0x0
2022/06/08 23:26 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-kvm panic: invalid allocation length: 0x0
2022/06/08 23:11 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3 panic: invalid allocation length: 0x0
2022/06/08 23:00 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3 panic: invalid allocation length: 0x0
2022/06/08 22:39 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3-race panic: invalid allocation length: 0x0
2022/06/08 22:20 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-1 panic: invalid allocation length: 0x0
2022/06/08 22:08 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-2-race panic: invalid allocation length: 0x0
2022/06/08 22:01 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-kvm panic: invalid allocation length: 0x0
2022/06/08 21:57 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-1 panic: invalid allocation length: 0x0
2022/06/08 21:49 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-2-cover panic: invalid allocation length: 0x0
2022/06/08 21:29 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-1-cover panic: invalid allocation length: 0x0
2022/06/08 21:00 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-1 panic: invalid allocation length: 0x0
2022/06/08 20:43 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-kvm-cover panic: invalid allocation length: 0x0
2022/06/08 20:30 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3-cover panic: invalid allocation length: 0x0
2022/06/08 20:06 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-2-cover panic: invalid allocation length: 0x0
2022/06/08 19:54 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-kvm-cover panic: invalid allocation length: 0x0
2022/06/08 19:43 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-kvm-cover panic: invalid allocation length: 0x0
2022/06/08 19:24 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-1 panic: invalid allocation length: 0x0
2022/06/08 19:20 gvisor 8b5289e723b5 0d5abf15 .config console log report info ci-gvisor-ptrace-3-cover panic: invalid allocation length: 0x0
2022/06/08 18:18 gvisor 8b5289e723b5 b2706118 .config console log report info ci-gvisor-ptrace-3 panic: invalid allocation length: 0x0
2022/06/08 16:15 gvisor 8b5289e723b5 b2706118 .config console log report info ci-gvisor-ptrace-3-race-cover panic: invalid allocation length: 0x0
2022/06/08 09:27 gvisor 68ec24098221 b2706118 .config console log report info ci-gvisor-ptrace-1-race-cover panic: invalid allocation length: 0x0
2022/06/07 03:36 gvisor a30c81cd8022 c8857892 .config console log report info ci-gvisor-ptrace-2-race-cover panic: invalid allocation length: 0x0
2022/06/06 18:24 gvisor f13e23932ba1 c8857892 .config console log report info ci-gvisor-kvm panic: invalid allocation length: 0x0
* Struck through repros no longer work on HEAD.