Skip to content

Commit

Permalink
ANDROID: fuse-bpf: Align data structs for 32-bit kernels
Browse files Browse the repository at this point in the history
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 <paullawrence@google.com>
  • Loading branch information
PaulLawrenceGoogle committed Sep 5, 2023
1 parent e9023ea commit 7a7749b
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions include/uapi/linux/fuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -977,15 +977,29 @@ struct fuse_removemapping_one {
/** 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
Expand All @@ -1001,6 +1015,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];
};
Expand Down

0 comments on commit 7a7749b

Please sign in to comment.