Hacker News new | ask | show | jobs
by PeterWhittaker 39 days ago
Your comment intrigued me so I read the issue, but I don't follow how his comments re a potential security concern and being able to overmount from inside the container lead to a conclusion of not seeing the point.

As a cybersecurity guy, my interpretation is that the requested change could introduce a vulnerability and that there is another potential path to achieve the same result, which should likely be explored first.

Any change that can compromise security needs significant justification, and should come with guards to allow it to be used in those cases where no other alternatives exist, without impacting other cases.

I've mostly used podman and am far from expert, and have long been intrigued by nspawn, so I really would like to understand the rationale.

Any other examples of nspawn mount limitations impacting operations without "workarounds"? Thanks!

1 comments

Passing /dev/dri/renderD128 or /dev/kfd to nspawn doesn't provide separation from the host like podman does. It's possible to run GPU workloads with nspawn, but this behavior makes it a bit trickier than simply passing --gpu or --device to podman.
From what I can tell, those options make the GPU available to podman, but without any form of host isolation/separation: the GPU is fully available without restrictions.

Since none of the existing namespaces treat GPUs directly (though perhaps this could be accomplished with cgroup?), this lack of isolation doesn’t surprise me.

While this may be useful for some workloads, the apparent lack of separation gives me pause from a security PoV.

One would hope that podman containers accessing GPUs are otherwise properly constrained to prevent their workloads from using GPU access to gain undesirable access to other hosts resources.

So I am left with my original question: what equivalency to podman, other than invocation convenience, is missing from nspawn? If none, it seems to me that having an awkward invocation in nspawn helps alert the user to the risks hidden by podman's convenience.