aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Lawrence <paullawrence@google.com>2022-04-22 21:10:22 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-04-22 21:10:22 +0000
commit8418f910f265530a0b00550081f5555adba11ef8 (patch)
tree6282a8f48d36ea02b62fe241decfe38514c2fd2a
parent63199a4c44c372d70a78c3a24badecde54344b4c (diff)
parent5f1c9d874b10948c4fb6e2105f366fb26b2a575c (diff)
downloadlibfuse-8418f910f265530a0b00550081f5555adba11ef8.tar.gz
ANDROID: fuse-bpf: Use fuse_bpf_args in uapi am: a57ca0355f am: c6263729aa am: 5f1c9d874b
Original change: https://android-review.googlesource.com/c/platform/external/libfuse/+/2072290 Change-Id: Id2d9aee9fd0c9db72d4b72e900e6d872cc13d578 Ignore-AOSP-First: this is an automerge Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--include/fuse_kernel.h50
1 files changed, 28 insertions, 22 deletions
diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h
index 70278fa..b1f1e1d 100644
--- a/include/fuse_kernel.h
+++ b/include/fuse_kernel.h
@@ -874,38 +874,44 @@ struct fuse_copy_file_range_in {
#ifdef __KERNEL__
struct fuse_mount;
+/*
+ * Fuse BPF Args
+ *
+ * Used to communicate with bpf programs to allow checking or altering certain values.
+ * The end_offset allows the bpf verifier to check boundaries statically. This reflects
+ * the ends of the buffer. size shows the length that was actually used.
+ *
+ */
+
/** One input argument of a request */
-struct fuse_in_arg {
- unsigned size;
+struct fuse_bpf_in_arg {
+ uint32_t size;
const void *value;
+ const void *end_offset;
};
/** One output argument of a request */
-struct fuse_arg {
- unsigned size;
+struct fuse_bpf_arg {
+ uint32_t size;
void *value;
+ void *end_offset;
};
-struct fuse_args {
+#define FUSE_MAX_IN_ARGS 5
+#define FUSE_MAX_OUT_ARGS 3
+
+#define FUSE_BPF_FORCE (1 << 0)
+#define FUSE_BPF_OUT_ARGVAR (1 << 6)
+
+struct fuse_bpf_args {
uint64_t nodeid;
uint32_t opcode;
- unsigned short in_numargs;
- unsigned short out_numargs;
- int force:1;
- int noreply:1;
- int nocreds:1;
- int in_pages:1;
- int out_pages:1;
- int out_argvar:1;
- int page_zeroing:1;
- int page_replace:1;
- int may_block:1;
- struct fuse_in_arg in_args[5];
- struct fuse_arg out_args[3];
- void (*end)(struct fuse_mount *fm, struct fuse_args *args, int error);
-
- /* Path used for completing d_canonical_path */
- struct path *canonical_path;
+ uint32_t error_in;
+ uint32_t in_numargs;
+ uint32_t out_numargs;
+ uint32_t flags;
+ struct fuse_bpf_in_arg in_args[FUSE_MAX_IN_ARGS];
+ struct fuse_bpf_arg out_args[FUSE_MAX_OUT_ARGS];
};
#endif