Page MenuHomeFreeBSD

imgact_binmisc: Optionally pre-open the interpreter vnode
ClosedPublic

Authored by dfr on Nov 18 2022, 3:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 8 2024, 5:10 AM
Unknown Object (File)
Mar 8 2024, 5:09 AM
Unknown Object (File)
Mar 8 2024, 5:09 AM
Unknown Object (File)
Mar 8 2024, 5:09 AM
Unknown Object (File)
Mar 8 2024, 4:56 AM
Unknown Object (File)
Dec 20 2023, 7:06 AM
Unknown Object (File)
Oct 27 2023, 11:02 PM
Unknown Object (File)
Sep 4 2023, 5:10 AM
Subscribers
None

Details

Summary

This allows the use of chroot and/or jail environments which depend on
interpreters registed with imgact_binmisc.

Test Plan

Ad-hoc testing of arm64 chroot environments with qemu-user-static

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dfr requested review of this revision.Nov 18 2022, 3:11 PM
dfr created this revision.

I added a new field to struct image_args. Since this was added to the end of the structure, it should make it possible to MFC to stable/13 since the structure is owned and zeroed by do_execve and any imgact modules should not be affected.

I'm not 100% sure about the vnode protocols are right, but they seem fine.
Not sure if I reinstall qemu and its implications, but that aught to be documented if it doesn't just work.

sys/kern/imgact_binmisc.c
69

Having this in the middle is OK, right?
I believe so, since this is in the .c file so no other files can reference it...

179

What happens if I reinstall qemu?

sys/sys/imgact.h
97

This is good.

This revision is now accepted and ready to land.Dec 7 2022, 11:57 PM
dfr marked 3 inline comments as done.Dec 8 2022, 8:36 AM

Thanks for the review. I will follow up with a PR for qemu-bsd-user to remove the logic which adds the emulator binary to emulated execve calls and make a separate review for the qemu-user-static-devel port to enable pre-open and also remind users to 'service qemu_user_static restart' or something similar after an upgrade.

sys/kern/imgact_binmisc.c
69

Yes - nothing outside this file can depend on the layout of imgact_binmisc_entry

179

The kernel will continue to use the old qemu until binmiscctl refreshes the mapping.

This revision was automatically updated to reflect the committed changes.
dfr marked 2 inline comments as done.