Replace ELFDATA2LSB with BORD in has_elf_identity (checkpoint-restore/criu#3059)

Resolves: RHEL-180600

Signed-off-by: Čestmír Kalina <ckalina@redhat.com>
This commit is contained in:
Čestmír Kalina 2026-07-23 17:18:28 +02:00
parent 556e79fba3
commit 19dce7978e
2 changed files with 54 additions and 1 deletions

45
3059.patch Normal file
View File

@ -0,0 +1,45 @@
From bf2225965e04bd38ac09ede9b8047382724a4764 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=8Cestm=C3=ADr=20Kalina?= <ckalina@redhat.com>
Date: Tue, 23 Jun 2026 20:12:56 +0200
Subject: [PATCH] vdso: replace ELFDATA2LSB with BORD in has_elf_identity
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Commit 2d2168fc9 hardcodes ELFDATA2LSB in place of a previously used
endian-aware macro BORD, causing issues on big endian architectures,
e.g., on s390x:
$ ./criu/criu check -v4
(00.000000) CRIU run id = 6b0cc8b9-0cbe-44e7-aeb4-7387862d9670
(00.000016) Version: 4.2 (gitid v4.2-211-g4d76d1acd)
[...]
(00.061309) vdso: Parsing at 3ffc75ae000 3ffc75b0000
(00.061319) Error (criu/pie-util-vdso.c:126): vdso: Unsupported ELF data encoding: 2
(00.061320) Error (criu/vdso.c:633): vdso: Failed to fill self vdso symtable
(00.061321) Error (criu/kerndat.c:2043): kerndat_vdso_fill_symtable failed when initializing kerndat.
(00.061367) Adjust mmap_min_addr 0x1000 -> 0x10000
(00.061368) Found mmap_min_addr 0x10000
(00.061374) files stat: fs/nr_open 1073741816
(00.061375) Error (criu/crtools.c:280): Could not initialize kernel features detection.
Fixes: 2d2168fc9 ("vdso: relax EI_OSABI check to support linux in ELF header")
Signed-off-by: Čestmír Kalina <ckalina@redhat.com>
---
criu/pie/util-vdso.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/criu/pie/util-vdso.c b/criu/pie/util-vdso.c
index 45fb6a648b..2cbe1072f9 100644
--- a/criu/pie/util-vdso.c
+++ b/criu/pie/util-vdso.c
@@ -122,7 +122,7 @@ static int has_elf_identity(Ehdr_t *ehdr)
#endif
/* check ELF data encoding */
- if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB) {
+ if (ehdr->e_ident[EI_DATA] != BORD) {
pr_err("Unsupported ELF data encoding: %d\n", ehdr->e_ident[EI_DATA]);
return false;
};

View File

@ -13,7 +13,7 @@
Name: criu
Version: 4.2
Release: 8%{?dist}
Release: 9%{?dist}
Summary: Tool for Checkpoint/Restore in User-space
License: GPL-2.0-only AND LGPL-2.1-only AND MIT
URL: http://criu.org/
@ -43,6 +43,9 @@ Patch7: https://patch-diff.githubusercontent.com/raw/checkpoint-restore/criu/pul
# Based on https://github.com/checkpoint-restore/criu/pull/3097
Patch8: compel-handle-rseq-in-generic-compel-code.patch
# RHEL-180600
Patch9: https://patch-diff.githubusercontent.com/raw/checkpoint-restore/criu/pull/3059.patch
# Add protobuf-c as a dependency.
# We use this patch because the protobuf-c package name
# in RPM and DEB is different.
@ -132,6 +135,7 @@ This script can help to workaround the so called "PID mismatch" problem.
%patch -P 6 -p1
%patch -P 7 -p1
%patch -P 8 -p1
%patch -P 9 -p1
%patch -P 99 -p1
%build
@ -207,6 +211,10 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libcriu.a
%doc %{_mandir}/man1/criu-ns.1*
%changelog
* Thu Jul 23 2026 Čestmír Kalina <ckalina@redhat.com> - 4.2-9
- replace ELFDATA2LSB with BORD in has_elf_identity (checkpoint-restore/criu#3059)
- Resolves: RHEL-180600
* Mon Jul 20 2026 Adrian Reber <areber@redhat.com> - 4.2-8
- Handle rseq in generic compel code (checkpoint-restore/criu#3097)