[Bug 298154] An invalid ELF fails with a bogus Input/output error (EIO) error when no actual IO error has occurred

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 03 Sep 2026 23:01:10 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298154

            Bug ID: 298154
           Summary: An invalid ELF fails with a bogus Input/output error
                    (EIO) error when no actual IO error has occurred
           Product: Base System
           Version: 15.1-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: misc
          Assignee: bugs@FreeBSD.org
          Reporter: yuri@freebsd.org

Created attachment 274390
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=274390&action=edit
invalid-elf

The attached ELF fails with the EIO error:
> $ ./invalid-elf
> bash: ./invalid-elf: Input/output error

ktrace shows that no EIO was returned.

In other cases appropriate errors are printed, for example
> $ ./invalid-elf-1
> ld-elf.so.1: ./invalid-elf-1: too few PT_LOAD segments

The attached bad ELF should also generate an appropriate error message instead
of EIO.

-- 
You are receiving this mail because:
You are the assignee for the bug.