| dee3902d | 12-Jan-2024 |
Kyle Evans <[email protected]> |
bhyveload(8): document some SECURITY CONSIDERATIONS
The situation is improved now that we're running in a sandbox, but there is still some host machine access that could be concerning depending on t
bhyveload(8): document some SECURITY CONSIDERATIONS
The situation is improved now that we're running in a sandbox, but there is still some host machine access that could be concerning depending on the context. These concerns may be somewhat mitigated by the fact that the host machine usually provides the loader binary, even when the guest image is providing the loader scripts -- they only bring the lua scripts, and they have to be able to execute arbitrary syscalls rather than the interfaces provided by libsa(3).
Reviewed by: jhb, markj
(cherry picked from commit 5df041c4bbf70d549b055f332630925295ad5aaf)
show more ...
|
| a95fbd3d | 09-Jan-2024 |
Kyle Evans <[email protected]> |
bhyveload: add CAP_SEEK to our dirfd rights
In the case of hostbase_fd, this is infact a bug fix; we have a seek callback that the host: filesystem may use in loader, and we really don't have a good
bhyveload: add CAP_SEEK to our dirfd rights
In the case of hostbase_fd, this is infact a bug fix; we have a seek callback that the host: filesystem may use in loader, and we really don't have a good excuse to break it.
bootfd-derived fds will only be used with fdlopen(3) and rtld doesn't seem to need pread / lseek at all for it today, but there's no reason to break if it finds a good reason to later.
Suggested by: markj
(cherry picked from commit cef5e56f3fea33d6c421276af49f2967453ad4ff)
show more ...
|
| 7b74346b | 08-Jan-2024 |
Kyle Evans <[email protected]> |
bhyveload: make error printing consistent
Previously we used a mix of perror(3) + exit(3) and err(3); standardize on the latter instead. This does remove one free() in an error path, because we're
bhyveload: make error printing consistent
Previously we used a mix of perror(3) + exit(3) and err(3); standardize on the latter instead. This does remove one free() in an error path, because we're decidedly leaking a lot more than just the loader name there (loader handle, vcpu, vmctx...) anyways.
Reviewed by: markj
(cherry picked from commit a4a838a31ac24e19c8ee68d45cf5234615d0b958)
show more ...
|
| 3b01995d | 05-Jan-2024 |
Kyle Evans <[email protected]> |
bhyveload: support guest rebooting from the loader
userboot has a EXIT_REBOOT code that it uses when the 'reboot' loader command is executed. Use that and longjmp back to reinit the VM entirely wit
bhyveload: support guest rebooting from the loader
userboot has a EXIT_REBOOT code that it uses when the 'reboot' loader command is executed. Use that and longjmp back to reinit the VM entirely with a reboot request. This fixes the 'reboot' option in the loader menu to actually reboot rather than shutdown the VM.
The JMP_* constants are introduced to keep track of why we're doing a longjmp, though they aren't currently used. We'll notably still do a complete reload of the interpreter to give the rebooted VM that new loader smell. It just seemed forward thinking to just keep track of the different setjmp points.
While we're here, we don't actually need to keep the fd we passed to fdlopen(3), so let's avoid leaking it.
Reviewed by: markj
(cherry picked from commit 24cd5c26fe3ef7181e85467d9d55afbd76af5a2c)
show more ...
|
| 4bd568bd | 05-Jan-2024 |
Kyle Evans <[email protected]> |
bhyveload: limit rights on the dirfds we create
In neither case do we need write access to the directories we're working with; userboot doesn't support fo_write on the host device, and the bootfd is
bhyveload: limit rights on the dirfds we create
In neither case do we need write access to the directories we're working with; userboot doesn't support fo_write on the host device, and the bootfd is only ever needed for loader loading.
This improves on 8bf0882e18 ("bhyveload: enter capability mode [...]") so that arbitrary code in the loader can't open writable fds to either of the directories we need to maintain access to.
Reviewed by: imp
(cherry picked from commit c067be72e835e469518ec985b6cc4e475c378944) (cherry picked from commit f9b17005bf8f1a30e2a74a3e66c92e34aa87f9bf)
show more ...
|