syzbot


panic: node.Readdir returned offset -ADDR less than input offset ADDR

Status: fixed on 2019/08/15 00:56
Reported-by: syzbot+8c5019c4d5d61294e916@syzkaller.appspotmail.com
Fix commit: ab6774cebf5c gvisor/fs: getdents returns 0 if offset is equal to FileMaxOffset
First crash: 2344d, last: 1999d

Sample crash report:
panic: node.Readdir returned offset -9223372036854775805 less than input offset 9223372036854775805

goroutine 193 [running]:
gvisor.googlesource.com/gvisor/pkg/sentry/fs.direntReaddir(0xc72d00, 0xc4205e9200, 0xc4206f41e0, 0xc65c60, 0xc42000f440, 0xc4204321e0, 0xc42000f460, 0x7ffffffffffffffd, 0x4103b8, 0x20, ...)
	pkg/sentry/fs/dirent.go:967 +0x446
gvisor.googlesource.com/gvisor/pkg/sentry/fs.DirentReaddir(0xc72d00, 0xc4205e9200, 0xc4206f41e0, 0xc65c60, 0xc42000f440, 0xc4204321e0, 0xc42000f460, 0x7fffffffffffffff, 0x8, 0xc420262040, ...)
	pkg/sentry/fs/dirent.go:917 +0x8a
gvisor.googlesource.com/gvisor/pkg/sentry/fs/fsutil.(*Handle).Readdir(0xc42000f440, 0xc72d00, 0xc4205e9200, 0xc4206ea120, 0xc69ec0, 0xc420101140, 0x0, 0x0, 0x0)
	pkg/sentry/fs/fsutil/handle.go:74 +0x134
gvisor.googlesource.com/gvisor/pkg/sentry/fs.(*File).Readdir(0xc4206ea120, 0xc72d00, 0xc4205e9200, 0xc69ec0, 0xc420101140, 0x0, 0x0)
	pkg/sentry/fs/file.go:216 +0x103
gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.getdents(0xc4205e9200, 0xc400000003, 0x200001c0, 0xbc, 0xbda820, 0x0, 0x0, 0x0)
	pkg/sentry/syscalls/linux/sys_getdents.go:82 +0x1ac
gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.Getdents(0xc4205e9200, 0x3, 0x200001c0, 0xbc, 0xb, 0x65732f636f72702f, 0x65732f636f72702f, 0x7fffffffffffffff, 0xc4204e9c08, 0x6f8b04, ...)
	pkg/sentry/syscalls/linux/sys_getdents.go:43 +0xe3
gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).executeSyscall(0xc4205e9200, 0x4e, 0x3, 0x200001c0, 0xbc, 0xb, 0x65732f636f72702f, 0x65732f636f72702f, 0xc4204e9ca8, 0xbb34a0, ...)
	pkg/sentry/kernel/task_syscall.go:162 +0x307
gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke(0xc4205e9200, 0x4e, 0x3, 0x200001c0, 0xbc, 0xb, 0x65732f636f72702f, 0x65732f636f72702f, 0x65732f636f72702f, 0x65732f636f72702f)
	pkg/sentry/kernel/task_syscall.go:278 +0x62
gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter(0xc4205e9200, 0x4e, 0x3, 0x200001c0, 0xbc, 0xb, 0x65732f636f72702f, 0x65732f636f72702f, 0xc4204de800, 0xc4204e9e00)
	pkg/sentry/kernel/task_syscall.go:241 +0x91
gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).doSyscall(0xc4205e9200, 0x2, 0xc42013cd80)
	pkg/sentry/kernel/task_syscall.go:216 +0x10c
gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*runApp).execute(0x0, 0xc4205e9200, 0xc65f20, 0x0)
	pkg/sentry/kernel/task_run.go:217 +0xed8
gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).run(0xc4205e9200, 0x7)
	pkg/sentry/kernel/task_run.go:95 +0x174
created by gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).Start
	pkg/sentry/kernel/task_start.go:251 +0x100

Crashes (26):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/06/28 22:58 https://gvisor.googlesource.com/gvisor master 6b6852bceb12 dba0b50e .config console log report syz C ci-gvisor-kvm-proxy-overlay-sandbox
2018/06/27 07:38 https://gvisor.googlesource.com/gvisor master dc33d71f8cf1 b0294c53 .config console log report syz C ci-gvisor-kvm-direct-sandbox
2018/06/27 02:43 https://gvisor.googlesource.com/gvisor master dc33d71f8cf1 b0294c53 .config console log report syz C ci-gvisor-kvm-proxy-overlay-sandbox
2018/06/26 23:18 https://gvisor.googlesource.com/gvisor master 0ac11de8d37a 089f1181 .config console log report syz C ci-gvisor-main
2018/06/26 23:13 https://gvisor.googlesource.com/gvisor master 0ac11de8d37a 089f1181 .config console log report syz C ci-gvisor-ptrace-direct-overlay-host
2018/06/26 23:18 https://github.com/dvyukov/gvisor.git race fb36f579ec12 089f1181 .config console log report syz C ci-gvisor-ptrace-proxy-sandbox-race
2019/06/06 22:03 https://gvisor.googlesource.com/gvisor master 79f7cb6c1c4c f5dd5568 .config console log report ci-gvisor-main
2019/04/16 05:07 https://gvisor.googlesource.com/gvisor master e8156667179c c402d8f1 .config console log report ci-gvisor-ptrace-direct-overlay-host
2019/04/04 23:29 https://gvisor.googlesource.com/gvisor master efe4461d74a1 6a475fff .config console log report ci-gvisor-kvm-direct-overlay-host-race
2019/03/21 00:45 https://gvisor.googlesource.com/gvisor master cea1dd7d21b9 142c38ee .config console log report ci-gvisor-kvm-direct-overlay-host-race
2019/01/09 23:54 https://gvisor.googlesource.com/gvisor master dd761c170cc2 45c0c1b1 .config console log report ci-gvisor-kvm-proxy-overlay-sandbox
2018/07/28 05:48 https://gvisor.googlesource.com/gvisor master 2793f7ac5f96 ebf656d7 .config console log report ci-gvisor-ptrace-direct-overlay-host
2018/07/27 05:55 https://gvisor.googlesource.com/gvisor master 6d7199bcffcb 375a3e31 .config console log report ci-gvisor-ptrace-direct-overlay-host
2018/07/23 07:27 https://gvisor.googlesource.com/gvisor master f543ada15005 8cc079c3 .config console log report ci-gvisor-ptrace-direct-overlay-host
2018/07/19 04:14 https://gvisor.googlesource.com/gvisor master c05660373e8b 49f35839 .config console log report ci-gvisor-ptrace-direct-overlay-host
2018/07/16 10:31 https://gvisor.googlesource.com/gvisor master 9059983fdb2c 92a49505 .config console log report ci-gvisor-ptrace-direct-overlay-host
2018/07/15 10:41 https://gvisor.googlesource.com/gvisor master 9059983fdb2c 92a49505 .config console log report ci-gvisor-main
2018/07/10 22:44 https://gvisor.googlesource.com/gvisor master 065d7cee9a55 2e0e3130 .config console log report ci-gvisor-ptrace-direct-overlay-host
2018/07/01 18:23 https://gvisor.googlesource.com/gvisor master ca353b53ed09 664ef9a3 .config console log report ci-gvisor-main
2018/07/01 12:54 https://gvisor.googlesource.com/gvisor master ca353b53ed09 664ef9a3 .config console log report ci-gvisor-ptrace-direct-overlay-host
2018/06/29 03:01 https://gvisor.googlesource.com/gvisor master 5a8e014c3d42 dba0b50e .config console log report ci-gvisor-ptrace-direct-overlay-host
2018/06/28 22:32 https://gvisor.googlesource.com/gvisor master 5a8e014c3d42 dba0b50e .config console log report ci-gvisor-ptrace-direct-overlay-host
2018/06/27 08:21 https://gvisor.googlesource.com/gvisor master dc33d71f8cf1 b0294c53 .config console log report ci-gvisor-ptrace-direct-overlay-host
2018/06/26 23:07 https://gvisor.googlesource.com/gvisor master 0ac11de8d37a 089f1181 .config console log report ci-gvisor-ptrace-direct-overlay-host
2018/07/15 14:56 https://github.com/dvyukov/gvisor.git race 54dabe736f40 92a49505 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
2018/07/01 16:48 https://github.com/dvyukov/gvisor.git race 082553a8233a 664ef9a3 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
* Struck through repros no longer work on HEAD.