Your message dated Sun, 18 Sep 2022 13:30:10 +0100
with message-id <[email protected]>
and subject line Re: Bug#1012321: Acknowledgement (interpreter incorrectly set
to /usr/lib/binfmt-support/run-detectors)
has caused the Debian Bug report #1012321,
regarding interpreter incorrectly set to /usr/lib/binfmt-support/run-detectors
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
1012321: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1012321
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: binfmt-support
Version: 2.2.2-1
Severity: normal
I just ran the following command
apt install --no-install-recommends binfmtc hatari jarwrapper llvm-11-runtime
llvm-12-runtime llvm-13-runtime llvm-14-runtime llvm-15-runtime love
mono-runtime python2.7-minimal python3.10-minimal python3.9-minimal sbcl
wine-binfmt
# grep detector /usr/share/binfmts/*
/usr/share/binfmts/cli:detector /usr/lib/cli/binfmt-detector-cli
/usr/share/binfmts/jarwrapper:detector /usr/bin/jardetector
$ grep detector /proc/sys/fs/binfmt_misc/*
cli:interpreter /usr/lib/binfmt-support/run-detectors
jarwrapper:interpreter /usr/lib/binfmt-support/run-detectors
llvm-12-runtime.binfmt:interpreter /usr/lib/binfmt-support/run-detectors
llvm-13-runtime.binfmt:interpreter /usr/lib/binfmt-support/run-detectors
llvm-14-runtime.binfmt:interpreter /usr/lib/binfmt-support/run-detectors
llvm-15-runtime.binfmt:interpreter /usr/lib/binfmt-support/run-detectors
Why is for llvm-1[2345]-runtime.binfmt the interpreter set to
/usr/lib/binfmt-support/run-detectors when the actual config does not
set any detector? Is that a bug or am I missing something?
Michael
-- System Information:
Debian Release: bookworm/sid
APT prefers unstable
APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 5.17.0-3-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_FIRMWARE_WORKAROUND
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages binfmt-support depends on:
ii init-system-helpers 1.63
ii libc6 2.33-7
ii libpipeline1 1.5.6-1
ii lsb-base 11.2
binfmt-support recommends no packages.
binfmt-support suggests no packages.
-- no debconf information
--- End Message ---
--- Begin Message ---
On Sat, Jun 04, 2022 at 12:57:33PM +0200, Michael Biebl wrote:
> The reproducer can be reduced further down to
>
> # apt install llvm-11-runtime llvm-12-runtime
>
> Might be related to the fact that all llvm-XX-runtime.binfmts configs use
> the same magic ?
Yes. This is an intentional implementation detail. If there are
multiple registered binary formats with the same specification
(magic/offset/mask/extension), then we can't tell the difference between
them. Rather than just throwing them all at the kernel and letting the
most-recently-registered one win, we interpose run-detectors in this
case so that it can decide, since we need that logic anyway in the case
of formats that have explicit detectors.
In the llvm-*-runtime case, this isn't super-useful, since it probably
still leaves the question of which one actually gets executed ambiguous.
In the case of cli vs. wine, this is the exact case that detectors were
first designed for. They both share the "MZ" magic, but cli gets to say
that it only runs for executables where /usr/lib/cli/binfmt-detector-cli
passes, and wine runs for everything else.
--
Colin Watson (he/him) [[email protected]]
--- End Message ---