fix: validate Linux spec early to prevent nil dereference panics#650
Conversation
✅ Deploy Preview for urunc canceled.
|
|
/cc @cmainas |
cmainas
left a comment
There was a problem hiding this comment.
Hello @rishi-jat ,
I have added a small comment regarding the new error. Other than it looks ok.
6391dbd to
3eff01d
Compare
PTAL |
|
Thank you @rishi-jat , you will need to add yourself in https://github.com/urunc-dev/urunc/blob/main/.github/contributors.yaml and rebase over main too. |
3eff01d to
e5d5d42
Compare
|
\
DONE , please take a look. Thanks! |
|
Hello @rishi-jat , please fix the linting errors. |
I checked and there are no current lint errors , can you please point out to me am i missing something ? |
|
Hello @rishi-jat , please squash your second commit with the first one. |
Signed-off-by: Rishi Jat <rishijat098@gmail.com> fix Signed-off-by: Rishi Jat <rishijat098@gmail.com>
Signed-off-by: Rishi Jat <rishijat098@gmail.com>
b570500 to
1fa0fc2
Compare
Done, PTAL. |
Description
Validate the OCI Linux spec early during container initialization and retrieval to prevent nil dereference panics caused by unsafe access to Spec.Linux.
This change establishes the Linux spec invariant once in:
and returns an explicit error when the Linux section is missing.
Additionally, Exec() now guards access to Spec.Linux.Resources.Memory since Resources remains optional even when the Linux spec is present.
Related issues
How was this tested?
LLM usage
N/A
Checklist
make lint).make test_ctr,make test_nerdctl,make test_docker,make test_crictl).