[openwrt/openwrt] busybox: backport hexdump fix for Big Endian systems
LEDE Commits
lede-commits at lists.infradead.org
Sun Nov 23 08:16:55 PST 2025
noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/749d54fea89914a5c26f4f2464b11af385130c49
commit 749d54fea89914a5c26f4f2464b11af385130c49
Author: Álvaro Fernández Rojas <noltari at gmail.com>
AuthorDate: Sun Nov 23 17:07:05 2025 +0100
busybox: backport hexdump fix for Big Endian systems
hexdump isn't working properly on some Big Endian systems, producing
incorrect output such as:
hexdump -vn 5 -e '"fd" 1/1 "%02x:" 2/2 "%x:"' /dev/urandom
fdff:542c0054:17920017:
Which should be:
fdff:542c:1792:
This breaks the default ULA prefix generation on some systems. See:
https://github.com/openwrt/openwrt/issues/19844
The issue has already been fixed upstream, so we can backport the fix:
https://git.busybox.net/busybox/commit/libbb/dump.c?id=f5c7cae55fc3e19d074198bc12152486067ea8c7
Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
---
...gression-for-uint16-on-big-endian-systems.patch | 41 ++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/package/utils/busybox/patches/003-hexdump-fix-regression-for-uint16-on-big-endian-systems.patch b/package/utils/busybox/patches/003-hexdump-fix-regression-for-uint16-on-big-endian-systems.patch
new file mode 100644
index 0000000000..5440c34f0a
--- /dev/null
+++ b/package/utils/busybox/patches/003-hexdump-fix-regression-for-uint16-on-big-endian-systems.patch
@@ -0,0 +1,41 @@
+From f5c7cae55fc3e19d074198bc12152486067ea8c7 Mon Sep 17 00:00:00 2001
+From: Radoslav Kolev <radoslav.kolev at suse.com>
+Date: Thu, 24 Apr 2025 00:45:25 +0300
+Subject: [PATCH] hexdump: fix regression for uint16 on big endian systems
+
+Commit 34751d8bf introduced a bug in the handling of uint16
+values on big endian systems not considered safe for unaligned
+access when falling back to memcpy.
+
+Signed-off-by: Radoslav Kolev <radoslav.kolev at suse.com>
+Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
+---
+ libbb/dump.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+--- a/libbb/dump.c
++++ b/libbb/dump.c
+@@ -667,15 +667,21 @@ static NOINLINE void display(priv_dumper
+ conv_u(pr, bp);
+ break;
+ case F_UINT: {
++ union {
++ uint16_t uval16;
++ uint32_t uval32;
++ } u;
+ unsigned value = (unsigned char)*bp;
+ switch (pr->bcnt) {
+ case 1:
+ break;
+ case 2:
+- move_from_unaligned16(value, bp);
++ move_from_unaligned16(u.uval16, bp);
++ value = u.uval16;
+ break;
+ case 4:
+- move_from_unaligned32(value, bp);
++ move_from_unaligned32(u.uval32, bp);
++ value = u.uval32;
+ break;
+ /* case 8: no users yet */
+ }
More information about the lede-commits
mailing list