Merge remote-tracking branch 'sm8350/lineage-20' into lineage-23.2

* sm8350/lineage-20: (148 commits)
  ANDROID: Add FUSE_BPF to gki_defconfig
  Reapply "UPSTREAM: seccomp: Remove bogus __user annotations"
  ANDROID: fuse: Open-code vma_set_file() logic in fuse_backing_mmap()
  BACKPORT: fuse: fix livelock in synchronous file put from fuseblk workers
  BACKPORT: compat_ioctl: move more drivers to compat_ptr_ioctl
  UPSTREAM: fuse: make sure reclaim doesn't write the inode
  UPSTREAM: ANDROID: fuse-bpf: Correct fuse bpf feature flag
  UPSTREAM: fuse: verify {g,u}id mount options correctly
  fixup! BACKPORT: fuse: name fs_context consistently
  BACKPORT: fuse: name fs_context consistently
  UPSTREAM: fuse: fix root lookup with nonzero generation
  UPSTREAM: ANDROID: fuse-bpf: Fix the issue of abnormal lseek system calls
  UPSTREAM: ANDROID: fuse-bpf: Follow mounts in lookups
  UPSTREAM: fuse: dax: set fc->dax to NULL in fuse_dax_conn_free()
  BACKPORT: ANDROID: fuse-bpf: Ignore readaheads unless they go to the daemon
  UPSTREAM: ANDROID: fuse-bpf: Add NULL pointer check in fuse_release_in
  UPSTREAM: ANDROID: fs/passthrough: Fix compatibility with R/O file system
  UPSTREAM: ANDROID: fuse-bpf: Add NULL pointer check in fuse_entry_revalidate
  UPSTREAM: ANDROID: fuse-bpf: Get correct inode in mkdir
  UPSTREAM: ANDROID: fuse-bpf: Use stored bpf for create_open
  ...

Change-Id: Ice6b8c09d19db311c827d0a9f48d46795be998ee
This commit is contained in:
Michael Bestas 2026-05-14 13:35:30 +02:00
commit e14e0696e2
No known key found for this signature in database
81 changed files with 7762 additions and 1069 deletions

View file

@ -199,6 +199,7 @@ enum bpf_prog_type {
BPF_PROG_TYPE_EXT,
BPF_PROG_TYPE_LSM,
BPF_PROG_TYPE_SK_LOOKUP,
BPF_PROG_TYPE_FUSE,
};
enum bpf_attach_type {

View file

@ -172,6 +172,9 @@
* - add FUSE_WRITE_KILL_PRIV flag
* - add FUSE_SETUPMAPPING and FUSE_REMOVEMAPPING
* - add map_alignment to fuse_init_out, add FUSE_MAP_ALIGNMENT flag
*
* 7.32
* - add flags to fuse_attr, add FUSE_ATTR_SUBMOUNT, add FUSE_SUBMOUNTS
*/
#ifndef _LINUX_FUSE_H
@ -207,7 +210,7 @@
#define FUSE_KERNEL_VERSION 7
/** Minor version number of this interface */
#define FUSE_KERNEL_MINOR_VERSION 31
#define FUSE_KERNEL_MINOR_VERSION 32
/** The node ID of the root inode */
#define FUSE_ROOT_ID 1
@ -231,7 +234,7 @@ struct fuse_attr {
uint32_t gid;
uint32_t rdev;
uint32_t blksize;
uint32_t padding;
uint32_t flags;
};
struct fuse_kstatfs {
@ -313,7 +316,10 @@ struct fuse_file_lock {
* FUSE_CACHE_SYMLINKS: cache READLINK responses
* FUSE_NO_OPENDIR_SUPPORT: kernel supports zero-message opendir
* FUSE_EXPLICIT_INVAL_DATA: only invalidate cached pages on explicit request
* FUSE_MAP_ALIGNMENT: map_alignment field is valid
* FUSE_MAP_ALIGNMENT: init_out.map_alignment contains log2(byte alignment) for
* foffset and moffset fields in struct
* fuse_setupmapping_out and fuse_removemapping_one.
* FUSE_SUBMOUNTS: kernel supports auto-mounting directory submounts
*/
#define FUSE_ASYNC_READ (1 << 0)
#define FUSE_POSIX_LOCKS (1 << 1)
@ -342,6 +348,7 @@ struct fuse_file_lock {
#define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
#define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
#define FUSE_MAP_ALIGNMENT (1 << 26)
#define FUSE_SUBMOUNTS (1 << 27)
#define FUSE_PASSTHROUGH (1 << 31)
/**
@ -418,6 +425,13 @@ struct fuse_file_lock {
*/
#define FUSE_FSYNC_FDATASYNC (1 << 0)
/**
* fuse_attr flags
*
* FUSE_ATTR_SUBMOUNT: Object is a submount root
*/
#define FUSE_ATTR_SUBMOUNT (1 << 0)
enum fuse_opcode {
FUSE_LOOKUP = 1,
FUSE_FORGET = 2, /* no reply */
@ -502,6 +516,23 @@ struct fuse_entry_out {
struct fuse_attr attr;
};
#define FUSE_ACTION_KEEP 0
#define FUSE_ACTION_REMOVE 1
#define FUSE_ACTION_REPLACE 2
struct fuse_entry_bpf_out {
uint64_t backing_action;
uint64_t backing_fd;
uint64_t bpf_action;
uint64_t bpf_fd;
};
struct fuse_entry_bpf {
struct fuse_entry_bpf_out out;
struct file *backing_file;
struct file *bpf_file;
};
struct fuse_forget_in {
uint64_t nlookup;
};
@ -620,6 +651,12 @@ struct fuse_read_in {
uint32_t padding;
};
struct fuse_read_out {
uint64_t offset;
uint32_t again;
uint32_t padding;
};
#define FUSE_COMPAT_WRITE_IN_SIZE 24
struct fuse_write_in {
@ -793,7 +830,7 @@ struct fuse_in_header {
uint32_t uid;
uint32_t gid;
uint32_t pid;
uint32_t padding;
uint32_t error_in;
};
struct fuse_out_header {
@ -898,4 +935,82 @@ struct fuse_copy_file_range_in {
uint64_t flags;
};
#define FUSE_SETUPMAPPING_FLAG_WRITE (1ull << 0)
#define FUSE_SETUPMAPPING_FLAG_READ (1ull << 1)
struct fuse_setupmapping_in {
/* An already open handle */
uint64_t fh;
/* Offset into the file to start the mapping */
uint64_t foffset;
/* Length of mapping required */
uint64_t len;
/* Flags, FUSE_SETUPMAPPING_FLAG_* */
uint64_t flags;
/* Offset in Memory Window */
uint64_t moffset;
};
struct fuse_removemapping_in {
/* number of fuse_removemapping_one follows */
uint32_t count;
};
struct fuse_removemapping_one {
/* Offset into the dax window start the unmapping */
uint64_t moffset;
/* Length of mapping required */
uint64_t len;
};
#define FUSE_REMOVEMAPPING_MAX_ENTRY \
(PAGE_SIZE / sizeof(struct fuse_removemapping_one))
/*
* 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_bpf_in_arg {
uint32_t size;
const void *value;
const void *end_offset;
};
/** One output argument of a request */
struct fuse_bpf_arg {
uint32_t size;
void *value;
void *end_offset;
};
#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;
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];
};
#define FUSE_BPF_USER_FILTER 1
#define FUSE_BPF_BACKING 2
#define FUSE_BPF_POST_FILTER 4
#define FUSE_OPCODE_FILTER 0x0ffff
#define FUSE_PREFILTER 0x10000
#define FUSE_POSTFILTER 0x20000
#endif /* _LINUX_FUSE_H */

View file

@ -16,4 +16,7 @@ struct virtio_fs_config {
__u32 num_request_queues;
} __attribute__((packed));
/* For the id field in virtio_pci_shm_cap */
#define VIRTIO_FS_SHMCAP_ID_CACHE 0
#endif /* _UAPI_LINUX_VIRTIO_FS_H */