syzbot


panic: runtime error: integer divide by zero

Status: fixed on 2020/12/30 01:06
Reported-by: syzbot+379bef03ef7b9b557c60@syzkaller.appspotmail.com
Fix commit: b3ff31d041c9 fix panic when calling SO_ORIGINAL_DST without initializing iptables
First crash: 1577d, last: 1543d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
gvisor panic: runtime error: integer divide by zero (3) C 443 739d 756d 14/26 fixed on 2022/11/18 03:22
gvisor panic: runtime error: integer divide by zero (2) C 56 756d 756d 14/26 fixed on 2022/11/01 08:39

Sample crash report:
panic: runtime error: integer divide by zero

goroutine 447 [running]:
panic(0x150e240, 0x218b320)
	GOROOT/src/runtime/panic.go:1064 +0x46d fp=0xc0004d0bf0 sp=0xc0004d0b38 pc=0x43611d
runtime.panicdivide()
	GOROOT/src/runtime/panic.go:191 +0x5b fp=0xc0004d0c10 sp=0xc0004d0bf0 pc=0x43488b
gvisor.dev/gvisor/pkg/tcpip/stack.(*ConnTrack).bucket(0xc0004801d0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x600000000, 0x800, 0x0)
	pkg/tcpip/stack/conntrack.go:509 +0x3df fp=0xc0004d0d08 sp=0xc0004d0c10 pc=0x9ecb3f
gvisor.dev/gvisor/pkg/tcpip/stack.(*ConnTrack).connForTID(0xc0004801d0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x600000000, 0x800, 0x0, 0x0)
	pkg/tcpip/stack/conntrack.go:247 +0xe0 fp=0xc0004d0eb8 sp=0xc0004d0d08 pc=0x9ea210
gvisor.dev/gvisor/pkg/tcpip/stack.(*ConnTrack).originalDst(0xc0004801d0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14ba160, 0xc00050ddbf, 0x203000, ...)
	pkg/tcpip/stack/conntrack.go:622 +0x158 fp=0xc0004d0fb0 sp=0xc0004d0eb8 pc=0x9ed5f8
gvisor.dev/gvisor/pkg/tcpip/stack.(*IPTables).OriginalDst(...)
	pkg/tcpip/stack/iptables.go:422
gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).GetSockOpt(0xc000486b00, 0x1490400, 0xc0002bd380, 0xc00050ddb0)
	pkg/tcpip/transport/tcp/endpoint.go:2022 +0x1eb fp=0xc0004d1128 sp=0xc0004d0fb0 pc=0xccbe1b
gvisor.dev/gvisor/pkg/sentry/socket/netstack.getSockOptIP(0xc000632a80, 0x7fbb901d5140, 0xc000486b00, 0x50, 0x31313131, 0x2, 0xc000010038, 0x7fbb901d5140, 0x2000)
	pkg/sentry/socket/netstack/netstack.go:1613 +0xfe7 fp=0xc0004d12d8 sp=0xc0004d1128 pc=0xd39957
gvisor.dev/gvisor/pkg/sentry/socket/netstack.GetSockOpt(0xc000632a80, 0x18b4640, 0xc0001c0100, 0x7fbb901d5140, 0xc000486b00, 0x2, 0x1, 0x0, 0x50, 0x31313131, ...)
	pkg/sentry/socket/netstack/netstack.go:998 +0x1bf fp=0xc0004d1360 sp=0xc0004d12d8 pc=0xd3326f
gvisor.dev/gvisor/pkg/sentry/socket/netstack.(*SocketOperations).GetSockOpt(0xc0001c0100, 0xc000632a80, 0x0, 0x50, 0x0, 0x31313131, 0x0, 0x0, 0x0)
	pkg/sentry/socket/netstack/netstack.go:981 +0xad9 fp=0xc0004d1598 sp=0xc0004d1360 pc=0xd32ff9
gvisor.dev/gvisor/pkg/sentry/syscalls/linux.getSockOpt(0xc000632a80, 0x7fbb901d5028, 0xc0001c0100, 0x0, 0x50, 0x0, 0x31313131, 0x9, 0x3, 0x3014a82a0)
	pkg/sentry/syscalls/linux/sys_socket.go:514 +0xd7 fp=0xc0004d1638 sp=0xc0004d1598 pc=0xc34a87
gvisor.dev/gvisor/pkg/sentry/syscalls/linux.GetSockOpt(0xc000632a80, 0x3, 0x0, 0x50, 0x0, 0x20000040, 0x400dd0, 0x0, 0x0, 0x0, ...)
	pkg/sentry/syscalls/linux/sys_socket.go:468 +0x295 fp=0xc0004d1740 sp=0xc0004d1638 pc=0xc34605
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall(0xc000632a80, 0x37, 0x3, 0x0, 0x50, 0x0, 0x20000040, 0x400dd0, 0x85, 0x340, ...)
	pkg/sentry/kernel/task_syscall.go:170 +0x44e fp=0xc0004d19e0 sp=0xc0004d1740 pc=0xb91fae
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke(0xc000632a80, 0x37, 0x3, 0x0, 0x50, 0x0, 0x20000040, 0x400dd0, 0x407baa, 0xc000633357)
	pkg/sentry/kernel/task_syscall.go:305 +0xb5 fp=0xc0004d1ac0 sp=0xc0004d19e0 pc=0xb93665
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter(0xc000632a80, 0x37, 0x3, 0x0, 0x50, 0x0, 0x20000040, 0x400dd0, 0xc0004d1ca0, 0x1109f66)
	pkg/sentry/kernel/task_syscall.go:265 +0x10a fp=0xc0004d1b70 sp=0xc0004d1ac0 pc=0xb92fca
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall(0xc000632a80, 0x2, 0xc0000fe080)
	pkg/sentry/kernel/task_syscall.go:240 +0x1e8 fp=0xc0004d1cb0 sp=0xc0004d1b70 pc=0xb927b8
gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute(0x0, 0xc000632a80, 0x1881760, 0x0)
	pkg/sentry/kernel/task_run.go:274 +0x17fb fp=0xc0004d1ee8 sp=0xc0004d1cb0 pc=0xb7fccb
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run(0xc000632a80, 0xd)
	pkg/sentry/kernel/task_run.go:92 +0x31d fp=0xc0004d1fd0 sp=0xc0004d1ee8 pc=0xb7d87d
runtime.goexit()
	src/runtime/asm_amd64.s:1373 +0x1 fp=0xc0004d1fd8 sp=0xc0004d1fd0 pc=0x46b961
created by gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start
	pkg/sentry/kernel/task_start.go:318 +0x19e

Crashes (116):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/08/02 12:33 gvisor d5b31458aae5 96dd3623 .config console log report syz C ci-gvisor-ptrace-proxy-sandbox-race
2020/08/02 12:30 gvisor d5b31458aae5 96dd3623 .config console log report syz C ci-gvisor-main
2020/08/02 12:12 gvisor d5b31458aae5 96dd3623 .config console log report syz C ci-gvisor-main
2020/08/02 12:05 gvisor d5b31458aae5 96dd3623 .config console log report syz C ci-gvisor-ptrace-proxy-sandbox-race
2020/09/04 15:51 gvisor ebf5293374bc abf9ba4f .config console log report ci-gvisor-kvm-proxy-overlay-sandbox
2020/09/03 17:10 gvisor ebf5293374bc abf9ba4f .config console log report ci-gvisor-kvm-proxy-overlay-sandbox
2020/08/28 11:26 gvisor 421e35020bbc 816e0689 .config console log report ci-gvisor-main
2020/08/28 11:26 gvisor 421e35020bbc 816e0689 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/28 02:10 gvisor 01a35a2f1930 816e0689 .config console log report ci-gvisor-main
2020/08/28 01:01 gvisor 01a35a2f1930 816e0689 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/27 23:33 gvisor 01a35a2f1930 816e0689 .config console log report ci-gvisor-main
2020/08/27 22:30 gvisor 01a35a2f1930 816e0689 .config console log report ci-gvisor-main
2020/08/27 21:19 gvisor 01a35a2f1930 816e0689 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/27 20:04 gvisor 01a35a2f1930 816e0689 .config console log report ci-gvisor-main
2020/08/27 11:08 gvisor 983a55aa0649 816e0689 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/27 00:40 gvisor 983a55aa0649 318430cb .config console log report ci-gvisor-main
2020/08/26 12:46 gvisor ebf5293374bc 318430cb .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/25 16:16 gvisor c61f6fcf6ab3 344da168 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/25 04:56 gvisor 89791a79bf83 622e52f4 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/25 01:52 gvisor 89791a79bf83 622e52f4 .config console log report ci-gvisor-main
2020/08/24 10:17 gvisor e7270096a7fb cef5ae68 .config console log report ci-gvisor-main
2020/08/23 18:13 gvisor e7270096a7fb 1da71ab0 .config console log report ci-gvisor-main
2020/08/23 07:35 gvisor e7270096a7fb 1da71ab0 .config console log report ci-gvisor-kvm-direct-sandbox
2020/08/23 01:25 gvisor e7270096a7fb 1da71ab0 .config console log report ci-gvisor-main
2020/08/22 15:53 gvisor 69008b68b0a7 6436ce4b .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/22 14:44 gvisor 69008b68b0a7 6436ce4b .config console log report ci-gvisor-main
2020/08/22 13:19 gvisor 69008b68b0a7 6436ce4b .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/22 11:59 gvisor 73c69cb4d8e7 6436ce4b .config console log report ci-gvisor-kvm-direct-sandbox
2020/08/22 10:56 gvisor 0324b94a73fe 6436ce4b .config console log report ci-gvisor-kvm-proxy-overlay-sandbox
2020/08/20 13:32 gvisor be76c7ce6eb8 ed282a3a .config console log report ci-gvisor-main
2020/08/19 22:22 gvisor 35dc7fe7e78f ed282a3a .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/19 18:08 gvisor 35dc7fe7e78f ed282a3a .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/19 17:16 gvisor 35dc7fe7e78f ed282a3a .config console log report ci-gvisor-main
2020/08/19 12:53 gvisor 6405525b046b a7d4a4f9 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/19 12:53 gvisor 6405525b046b a7d4a4f9 .config console log report ci-gvisor-main
2020/08/18 21:48 gvisor 6d0c5803d557 635f68f6 .config console log report ci-gvisor-main
2020/08/18 04:26 gvisor 13a8ae81b236 4a68e16f .config console log report ci-gvisor-kvm-direct-sandbox
2020/08/18 04:06 gvisor 97263e505324 4a68e16f .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/18 03:58 gvisor 97263e505324 4a68e16f .config console log report ci-gvisor-main
2020/08/18 03:02 gvisor 13a8ae81b236 4a68e16f .config console log report ci-gvisor-kvm-direct-sandbox
2020/08/18 03:01 gvisor 97263e505324 4a68e16f .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/18 03:01 gvisor 97263e505324 4a68e16f .config console log report ci-gvisor-main
2020/08/18 03:00 gvisor 13a8ae81b236 4a68e16f .config console log report ci-gvisor-kvm-direct-sandbox
2020/08/18 02:41 gvisor 97263e505324 4a68e16f .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/17 22:36 gvisor 97263e505324 4a68e16f .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/17 22:15 gvisor 97263e505324 4a68e16f .config console log report ci-gvisor-main
2020/08/17 21:43 gvisor 13a8ae81b236 4a68e16f .config console log report ci-gvisor-kvm-direct-sandbox
2020/08/17 21:41 gvisor 97263e505324 4a68e16f .config console log report ci-gvisor-main
2020/08/17 21:19 gvisor 97263e505324 4a68e16f .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2020/08/17 21:19 gvisor 97263e505324 4a68e16f .config console log report ci-gvisor-main
2020/08/15 01:46 gvisor 3be8b49c703e c2707aa5 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
* Struck through repros no longer work on HEAD.