/proc/sys/fs/binfmt_misc/ empty even though binfmt_misc is loaded

Bug #1878413 reported by Hans-Christoph Steiner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
binfmt-support
New
Undecided
Unassigned

Bug Description

_apksigner_ uses binfmt to execute via _jarwrapper_, since it is a JAR. We have a test suite that relies on _apksigner_ working. It was running fine in Ubuntu/bionic. Since it was pegged to LTS, it got upgraded to Ubuntu/focal and it stopped working. This is likely because /proc/sys/fs/binfmt_misc/ is totally empty. The "binfmt_misc" kernel module shows as loaded:

$ grep binfmt /proc/modules
binfmt_misc 20480 1 - Live 0xffffffffc0452000

This relies on binfmt support in gitlab.com's CI runner setup, based on Docker. binfmt works in containers there, for example on Ubuntu/bionic:
https://gitlab.com/fdroid/fdroidserver/-/jobs/516857857

Something in Ubuntu/focal broke this when running focal in the container on the same Docker host runners:
https://gitlab.com/fdroid/fdroidserver/-/jobs/547148092

Debian's ci.debian.net lxc runners also have a similar problem, it might be related:
https://salsa.debian.org/ci-team/debian-ci-config/-/issues/1

affects: qemu → binfmt-support
Revision history for this message
Laurent Vivier (laurent-vivier) wrote :

The binfmt_misc filesystem must be mounted on /proc/sys/fs/binfmt_misc to work.

$ mount|grep ^binfmt_misc
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)

Revision history for this message
Hans-Christoph Steiner (eighthave) wrote : Re: [Bug 1878413] Re: /proc/sys/fs/binfmt_misc/ empty even though binfmt_misc is loaded

From my experience, that mounting happens automatically once
binfmt-support is installed. At least that is the case on the
Ubuntu/bionic jobs and on my own Debian machines. Did something change
so that now it must be manually mounted?

Revision history for this message
Hans-Christoph Steiner (eighthave) wrote :

It seems in the focal container, binfmt_misc doesn't get setup properly:
https://gitlab.com/eighthave/fdroidserver/-/jobs/550962360

$ grep binfmt /proc/modules
binfmt_misc 20480 1 - Live 0xffffffffc0461000
$ mount | grep binfmt_misc || mount binfmt_misc /proc/sys/fs/binfmt_misc
mount: /proc/sys/fs/binfmt_misc: special device binfmt_misc does not exist.
$

Revision history for this message
Hans-Christoph Steiner (eighthave) wrote :

Ok, your hint lead me to the fix:

$ mount | grep binfmt_misc || mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc

I guess this mounting was somehow happening automatically before, but now it seems that it is handled by systemd in a user system. But a container usually doesn't run systemd.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.