[openwrt/openwrt] ucode: add padding to uc_resource_ext_t

LEDE Commits lede-commits at lists.infradead.org
Wed Jul 23 03:19:41 PDT 2025


nbd pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/3bdd6d492ee24bb46c8578ef939e41f3c998dda9

commit 3bdd6d492ee24bb46c8578ef939e41f3c998dda9
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Jul 23 12:16:03 2025 +0200

    ucode: add padding to uc_resource_ext_t
    
    Fixes misaligned allocations for ext resources
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
    (cherry picked from commit 6c22e8ef538926cec829dcb98f04c0347e621b7f)
---
 ...100-ucode-add-padding-to-uc_resource_ext_t.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/package/utils/ucode/patches/100-ucode-add-padding-to-uc_resource_ext_t.patch b/package/utils/ucode/patches/100-ucode-add-padding-to-uc_resource_ext_t.patch
new file mode 100644
index 0000000000..f8a8cf29cc
--- /dev/null
+++ b/package/utils/ucode/patches/100-ucode-add-padding-to-uc_resource_ext_t.patch
@@ -0,0 +1,21 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Mon, 21 Jul 2025 21:07:17 +0200
+Subject: [PATCH] ucode: add padding to uc_resource_ext_t
+
+This ensures that user data structures tied to the ext resource are aligned
+to 64 bit, as usually guaranteed by the memory allocator.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/include/ucode/types.h
++++ b/include/ucode/types.h
+@@ -213,6 +213,8 @@ typedef struct {
+ 	uint32_t persistent:1;
+ 	uint32_t uvcount:8;
+ 	uint32_t datasize:20;
++
++	uint32_t _pad;
+ } uc_resource_ext_t;
+ 
+ uc_declare_vector(uc_resource_types_t, uc_resource_type_t *);




More information about the lede-commits mailing list