]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyveload: limit rights on the dirfds we create
authorKyle Evans <kevans@FreeBSD.org>
Fri, 5 Jan 2024 06:21:14 +0000 (00:21 -0600)
committerKyle Evans <kevans@FreeBSD.org>
Fri, 5 Jan 2024 06:21:14 +0000 (00:21 -0600)
commitc067be72e835e469518ec985b6cc4e475c378944
tree223e555fc51c160e511e8223e1edb2b983728d94
parent70dc6b2ce314a0f32755005ad02802fca7ed186e
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
Differential Revision: https://reviews.freebsd.org/D43315
usr.sbin/bhyveload/bhyveload.c