-
Notifications
You must be signed in to change notification settings - Fork 2.2k
specconv: fix null spec.Process making runc panic #1826
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
specconv: fix null spec.Process making runc panic #1826
Conversation
|
@dongsupark many thanks for your comments~ #1726 does more checking, but it seems the author quits on the PR. Should we continue on this PR? |
What did I quit on? I'm not aware of any outstanding change requests short of this thread, where I'm waiting on maintainer follow-up. |
|
@wking sorry for that~ so let's wait for your pr~ |
|
needs rebase |
aad422f to
60473a5
Compare
60473a5 to
30b301b
Compare
|
Thanks for remainding~ @AkihiroSuda The part of spec_linux.go is already fix by 16d55f1, but the test in spec_linux_test.go may still has its value. Merge it if you think it is valuable 😄 |
Signed-off-by: l00397676 <[email protected]>
30b301b to
62cfad9
Compare
|
ping @opencontainers/runc-maintainers |
ProcessofSpec structis a pointer:When calling
CreateLibcontainerConfig()withopts.Spec.Process: nil, runc will panic.I added a new test case
TestNullProcessinlibcontainer/specconv, it will failed with:=== RUN TestNullProcess --- FAIL: TestNullProcess (0.00s) panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0xc8 pc=0x540029] goroutine 20 [running]: testing.tRunner.func1(0xc42007e9c0) /usr/lib/golang/src/testing/testing.go:622 +0x29d panic(0x57c280, 0x861a20) /usr/lib/golang/src/runtime/panic.go:489 +0x2cf github.com/opencontainers/runc/libcontainer/specconv.CreateLibcontainerConfig(0xc42003af70, 0x3, 0xc42007ad00, 0xc42007c040) /home/workspace/src/github.com/opencontainers/runc/libcontainer/specconv/spec_linux.go:244 +0x7b9 github.com/opencontainers/runc/libcontainer/specconv.TestNullProcess(0xc42007e9c0) /home/workspace/src/github.com/opencontainers/runc/libcontainer/specconv/spec_linux_test.go:456 +0xa8 testing.tRunner(0xc42007e9c0, 0x5b9440) /usr/lib/golang/src/testing/testing.go:657 +0x96 created by testing.(*T).Run /usr/lib/golang/src/testing/testing.go:697 +0x2ca FAIL github.com/opencontainers/runc/libcontainer/specconv 0.009sSo I wrote this PR.
Please help to review and share your comments.
Signed-off-by: Jingxiao Lu [email protected]