diff --git a/auto_patch/common14-5.15/common/02_not_arm64_android/0003-ANDROID-fuse-bpf-Align-data-structs-for-32-bit-kerne.patch b/auto_patch/common14-5.15/common/02_not_arm64_android/0003-ANDROID-fuse-bpf-Align-data-structs-for-32-bit-kerne.patch new file mode 100755 index 000000000..932b2edd1 --- /dev/null +++ b/auto_patch/common14-5.15/common/02_not_arm64_android/0003-ANDROID-fuse-bpf-Align-data-structs-for-32-bit-kerne.patch @@ -0,0 +1,65 @@ +From d1ce15f9fcba52d106bcbab9fd65e1900d602d04 Mon Sep 17 00:00:00 2001 +From: Paul Lawrence +Date: Fri, 7 Jul 2023 12:33:52 -0700 +Subject: [PATCH] ANDROID: fuse-bpf: Align data structs for 32-bit kernels + +BPF is always 64-bit code, so we need to pad the uapi structs to be the +same on 32-bit as 64-bit + +Bug: 285477572 +Test: Cuttlefish x86_64, x86 and x86 only all boot and load fuseMedia +Change-Id: Idf5b09b2581b8d097048e7d2ff4039cd1806c082 +Signed-off-by: Paul Lawrence +--- + include/uapi/linux/android_fuse.h | 23 +++++++++++++++++++---- + 1 file changed, 19 insertions(+), 4 deletions(-) + +diff --git a/include/uapi/linux/android_fuse.h b/include/uapi/linux/android_fuse.h +index 221e30ea7f01..58f3d171952d 100644 +--- a/include/uapi/linux/android_fuse.h ++++ b/include/uapi/linux/android_fuse.h +@@ -56,15 +56,29 @@ struct fuse_in_postfilter_header { + /** One input argument of a request */ + struct fuse_bpf_in_arg { + uint32_t size; +- const void *value; +- const void *end_offset; ++ uint32_t padding; ++ union { ++ const void *value; ++ uint64_t padding2; ++ }; ++ union { ++ const void *end_offset; ++ uint64_t padding3; ++ }; + }; + + /** One output argument of a request */ + struct fuse_bpf_arg { + uint32_t size; +- void *value; +- void *end_offset; ++ uint32_t padding; ++ union { ++ void *value; ++ uint64_t padding2; ++ }; ++ union { ++ void *end_offset; ++ uint64_t padding3; ++ }; + }; + + #define FUSE_MAX_IN_ARGS 5 +@@ -80,6 +94,7 @@ struct fuse_bpf_args { + uint32_t in_numargs; + uint32_t out_numargs; + uint32_t flags; ++ uint32_t padding; + struct fuse_bpf_in_arg in_args[FUSE_MAX_IN_ARGS]; + struct fuse_bpf_arg out_args[FUSE_MAX_OUT_ARGS]; + }; +-- +2.25.1 +