firecracker-microvm / firecracker-microvm/firecracker-go-sdk

Jailer LinkFilesHandler should check if m.Cfg.JailerCfg.ChrootBaseDir is empty

Open
#313 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
672
Forks
166
PR merge metrics
No merged PRs in 30d

Description

If yes, it should use the value of `defaultJailerPath` instead. The issue can be reproduced by using `firectl` with jailer but without `--chroot-base-dir`. Example:

```
radek@r720sas:~/dev/golang/src/github.com/firecracker-microvm/firectl$ sudo ./firectl --jailer=/usr/bin/jailer --exec-file=/usr/bin/firecracker-v0.22.4-x86_64 --id=alpine --kernel=/firecracker/kernels/vmlinux-v5.8 --root-drive=/firecracker/filesystems/alpine-base-root.ext4 --cni-network=alpine --ncpus=1 --memory=128
INFO[0000] Called startVMM(), setting up a VMM on /srv/jailer/firecracker-v0.22.4-x86_64/alpine/root/run/firecracker.socket
WARN[0000] Failed handler "fcinit.LinkFilesToRootFS": link /firecracker/kernels/vmlinux-v5.8 firecracker-v0.22.4-x86_64/alpine/root/vmlinux-v5.8: no such file or directory
FATA[0000] Failed to start machine: link /firecracker/kernels/vmlinux-v5.8 firecracker-v0.22.4-x86_64/alpine/root/vmlinux-v5.8: no such file or directory
radek@r720sas:~/dev/golang/src/github.com/firecracker-microvm/firectl$ sudo tree /srv/jailer/
/srv/jailer/
└── firecracker-v0.22.4-x86_64
└── alpine
└── root
├── dev
│   ├── kvm
│   └── net
│   └── tun
├── firecracker-v0.22.4-x86_64
└── run
```

The place in the code: https://github.com/firecracker-microvm/firecracker-go-sdk/blob/master/jailer.go#L360.

I can prepare a PR.

Contributor guide

Open the contributing guide

Research direction

Start at jailer.go around the LinkFilesHandler implementation referenced in the issue, and trace how m.Cfg.JailerCfg.ChrootBaseDir and defaultJailerPath are populated. Reproduce with firectl using jailer without --chroot-base-dir; done means the kernel and other files link successfully using defaultJailerPath when the configured chroot base directory is empty.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.