allow the creation of architecture emulation containers where the emulator binary is outside the container
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest posting 2/23 patches 3 repliesIn review
- v3 posting 1/23 patches 2 repliesSuperseded
- v23 patches 8 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 2 patches | 0 replies | Superseded |
Changes in v3 from the cover letter
* Collected acks from Jan Kara and Serge Hallyn
* Fixed doc spelling errors
* fput -> put_filp in error path
Patches in v3 posting 2/2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | fs: add filp_clone_open APIfs/ fs/ | +21 | 0 replies | |
| 2/3 | binfmt_misc: add persistent opened binary handler for containersfs/ | +39 | 0 replies | |
| 3/3 | binfmt_misc: add F option description to documentationDocumentation/ | +7 | 3 replies |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Serge Hallyn | Jan Kara |
|---|---|---|
| Series | A-b | A-b |
| 1/3 | A-b | A-b |
| 2/3 | A-b | |
| 3/3 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [Patch resend v3 0/3] allow the creation of architecture emulation containers where the emulator binary is outside the container
Changes in v3:
* Collected acks from Jan Kara and Serge Hallyn
* Fixed doc spelling errors
* fput -> put_filp in error path
Changes in v2:
* Use oldfile f_creds for the vfs_open credentials in filp_clone_open()
* remove spurious fput() after filp_close()
* Add documentation for the F option
There's also now a git tree at
https://git.kernel.org/cgit/linux/kernel/git/jejb/binfmt_misc.git
Original cover letter:
I've recently been playing a lot with architecture emulation containers using qemu, mainly so I can build and test the arm secure boot toolchain on my x86 laptop (not having any arm server hardware).
The process for bringing up architecture emulation containers using qemu-user is very cumbersome because the emulation has to be installed within the container. This is bad for several reasons, firstly because it contaminates the container image to have an emulator sitting inside it. Secondly it means that all orchestration systems have to be explicitly modified to work with non-native architectures and thirdly it means that the consumer of the container can accidentally destroy the emulation and thus permanently crash the container.
The fix for this is to add a mode to binfmt_misc where the emulation can be permanently installed from the current mount namespace and where it survives both chroot and changes of mount namespace, effectively allowing the container to run using the emulator, but where the emulator itself isn't present within the container.
There are a couple of downsides to this, firstly the mapping of the interpreter is accessible inside the container even if the actual file isn't (I don't think this is really a security problem) and secondly, to update the emulator package, you now have to remove the emulation update and reinstall it, but this should be easy to do with packaging scripts. Finally, the emulator must be static otherwise the container would crash when the elf binary format attempted to run the elf interpreter.
I'm not really a regular FS developer, so I'd appreciate FS people taking a look at the new filp_clone_open() API and whether I got everything correct.
Thanks,
James
---
James Bottomley (3):
fs: add filp_clone_open API
binfmt_misc: add persistent opened binary handler for containers
binfmt_misc: add F option description to documentation
Documentation/binfmt_misc.txt | 7 +++++++ fs/binfmt_misc.c | 41 +++++++++++++++++++++++++++++++++++++++-- fs/internal.h | 1 + fs/open.c | 20 ++++++++++++++++++++ 4 files changed, 67 insertions(+), 2 deletions(-)