Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iso9660] Index out of range panic #103

Closed
mraerino opened this issue Mar 31, 2021 · 4 comments · Fixed by #106
Closed

[iso9660] Index out of range panic #103

mraerino opened this issue Mar 31, 2021 · 4 comments · Fixed by #106

Comments

@mraerino
Copy link

mraerino commented Mar 31, 2021

I'm getting this panic as part of running the linuxkit metadata service

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/linuxkit/linuxkit/pkg/metadata/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660.parseDirEntry(0xa60458, 0x0, 0x0, 0xc0000e4000, 0x17000, 0x0, 0x0)
	/go/src/github.com/linuxkit/linuxkit/pkg/metadata/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/directoryentry.go:281 +0x789
github.com/linuxkit/linuxkit/pkg/metadata/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660.Read(0x818500, 0xc00000e068, 0x400000, 0x0, 0x1000, 0x1, 0x8122e0, 0xc000010ed0)
	/go/src/github.com/linuxkit/linuxkit/pkg/metadata/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/iso9660.go:223 +0x965
github.com/linuxkit/linuxkit/pkg/metadata/vendor/github.com/diskfs/go-diskfs/disk.(*Disk).GetFilesystem(0xc000078230, 0x0, 0x0, 0xc000078230, 0x0, 0x0)
	/go/src/github.com/linuxkit/linuxkit/pkg/metadata/vendor/github.com/diskfs/go-diskfs/disk/disk.go:227 +0x241

when i mount the cdrom in linux it works fine and i can list the files on it and view them

here is an image of the cdrom: broken-cdrom.img.gz

@mraerino
Copy link
Author

mraerino commented Apr 1, 2021

ok, i did some more investigation into this

looks like this is caused by a wrongly detected physical block size on the device.

  • iso9660.Read(f, 0, 0, 2048) works fine
  • iso9660.Read(f, 0, 0, 4096) panics

I think it should not panic, but produce an error instead

@deitch
Copy link
Collaborator

deitch commented Apr 1, 2021

@mraerino could you share a simple program that can replicate this?

@mraerino
Copy link
Author

mraerino commented Apr 1, 2021

i put a test here which panics: #105

@deitch
Copy link
Collaborator

deitch commented Apr 1, 2021

Please try the branch with the PR at #106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants