🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
1 messages
1 total messages Started by Josh Triplett Wed, 11 Nov 2026 07:00
Bug#1153703: `dash ./prog` tries to execute binary files as scripts
#4105
Author: Josh Triplett
Date: Wed, 11 Nov 2026 07:00
34 lines
4100 bytes
Package: dash
Version: 0.5.12-12
Severity: normal
X-Debbugs-Cc: josh@joshtriplett.org

dash in Debian has a patch so that `dash -c ./prog`, after getting
ENOEXEC, will check if the file looks binary before trying to run it as
a shell script.

However, dash doesn't do the same check when handed the program like
`dash ./prog`. (bash does check this.)

/tmp/temp$ file prog
prog: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped
/tmp/temp$ uname -m
x86_64
/tmp/temp$ ./prog
-bash: ./prog: cannot execute binary file: Exec format error
(126) /tmp/temp$ bash -c ./prog
bash: line 1: ./prog: cannot execute binary file: Exec format error
(126) /tmp/temp$ bash ./prog
./prog: ./prog: cannot execute binary file
(126) /tmp/temp$ dash -c ./prog
dash: 1: ./prog: Exec format error
(126) /tmp/temp$ dash ./prog
./prog: 13: cannot open �: No such file
./prog: 14: Syntax error: word unexpected (expecting ")")

I ran into this, in particular, by cross-configuring a Linux kernel tree
for aarch64 on my x86-64 laptop, such that scripts/kconfig/conf was an
x86-64 ELF binary, and then trying to build the resulting kernel tree on
a native aarch64 system. The Makefile ended up trying to run
scripts/kconfig/conf with dash.

Working on a patch for this.

-- System Information:
Debian Release: forky/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: arm64

Kernel: Linux 7.3.3+deb14-amd64 (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dash depends on:
ii  debianutils  5.24
ii  libc6        2.43-7

dash recommends no packages.

dash suggests no packages.

-- debconf information excluded
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads