Skip to content

buildkit/buildx/binfmt unable to build/run aarch64 images using gnu tar with CVE-2025-34482 patch #6475

@chadlwilson

Description

@chadlwilson

Contributing guidelines and issue reporting guide

Well-formed report checklist

  • I have found a bug that the documentation does not mention anything about my problem
  • I have found a bug that there are no open or closed issues that are related to my problem
  • I have provided version/information about my environment and done my best to provide a reproducer

Description of bug

Bug description

As noted comprehensively in the upstream repo issue at tonistiigi/binfmt#285 (and proposed fix via QEMU 10.1 upgrade at tonistiigi/binfmt#287 ) the QEMU version contained within current binfmt/buildkit cannot emulate aarch64 correctly when qemu is compiled with musl libc.

This is breaking cross-arch use of gnu tar with versions that include the upstream patch for CVE-2025-45582 since tar now uses O_LARGEFILE which is not declared correctly within QEMU for aarch64.

QEMU folks have hotfixed upstream, and this has been brought down into Alpine main and 3.23-stable at the moment.

Raising an issue here for searchability since the affected interface for users is mainly via buildkit/buildx rather than binfmt directly.

Reproduction

A repo demonstrating the issue on latest buidkit via GHA is available at https://github.com/chadlwilson/buildkit-tar-issue but looks something like

docker buildx create --use --name tmp-builder --driver-opt image=moby/buildkit:v0.26.3
docker buildx inspect --bootstrap tmp-builder
docker buildx build --pull --platform linux/arm64 . --tag latest

Shows it working with older tar, then failing with newer:

FROM almalinux:10-minimal
RUN microdnf -y install gzip tar-1.35-7.el10 && \
    (rpm -qa | grep tar) && \
    curl --fail --location --silent --show-error \
    https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25.0.1%2B8/OpenJDK25U-jre_$(uname -m | sed -e s/86_//g)_linux_hotspot_25.0.1_8.tar.gz --output /tmp/jre.tar.gz && \
    mkdir -p /gocd-jre && \
    QEMU_STRACE=1 tar -xvf /tmp/jre.tar.gz -C /gocd-jre && \
    microdnf -y install gzip tar-1.35-9.el10_1 && \
    QEMU_STRACE=1 tar -xvf /tmp/jre.tar.gz -C /gocd-jre

Version information

Client: Docker Engine - Community
 Version:    28.0.4
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.30.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.38.2
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 28.0.4
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: false
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: dea7da592f5d1d2b7755e3a161be07f43fad8f75
 runc version: v1.3.4-0-gd6d73eb8
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.11.0-1018-azure
 Operating System: Ubuntu 24.04.3 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 15.62GiB
 Name: runnervmi13qx
 ID: cad06968-cefe-42f1-8413-b84e8b052c72
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: githubactions
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false

Name:          tmp-builder
Driver:        docker-container
Last Activity: 2026-01-15 06:40:13 +0000 UTC

Nodes:
Name:                  tmp-builder0
Endpoint:              unix:///var/run/docker.sock
Driver Options:        image="moby/buildkit:v0.26.3"
Status:                running
BuildKit daemon flags: --allow-insecure-entitlement=network.host
BuildKit version:      v0.26.3
Platforms:             linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/386
Labels:
 org.mobyproject.buildkit.worker.executor:         oci
 org.mobyproject.buildkit.worker.hostname:         91f33254292b
 org.mobyproject.buildkit.worker.network:          host
 org.mobyproject.buildkit.worker.oci.process-mode: sandbox
 org.mobyproject.buildkit.worker.selinux.enabled:  false
 org.mobyproject.buildkit.worker.snapshotter:      overlayfs
GC Policy rule#0:
 All:            false
 Filters:        type==source.local,type==exec.cachemount,type==source.git.checkout
 Keep Duration:  48h0m0s
 Max Used Space: 488.3MiB
GC Policy rule#1:
 All:            false
 Keep Duration:  1440h0m0s
 Reserved Space: 7.451GiB
 Max Used Space: 54.02GiB
 Min Free Space: 13.97GiB
GC Policy rule#2:
 All:            false
 Reserved Space: 7.451GiB
 Max Used Space: 54.02GiB
 Min Free Space: 13.97GiB
GC Policy rule#3:
 All:            true
 Reserved Space: 7.451GiB
 Max Used Space: 54.02GiB
 Min Free Space: 13.97GiB

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions