mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
ANDROID: fuse-bpf: Run bpf with migration disabled
To avoid a BUG_ON, we must disable migration before running any bpf
program.
Bug: 273620140
Test: fuse-test passes, no bug with CONFIG_DEBUG_ATOMIC_SLEEP
Change-Id: I9ed69ae93fc4b922782fccde293cb02b3eae3f06
Signed-off-by: Paul Lawrence <paullawrence@google.com>
(cherry picked from commit 0411f8d9df)
This commit is contained in:
@@ -1917,6 +1917,16 @@ void __exit fuse_bpf_cleanup(void);
|
||||
|
||||
ssize_t fuse_bpf_simple_request(struct fuse_mount *fm, struct fuse_bpf_args *args);
|
||||
|
||||
static inline int fuse_bpf_run(struct bpf_prog *prog, struct fuse_bpf_args *fba)
|
||||
{
|
||||
int ret;
|
||||
|
||||
migrate_disable();
|
||||
ret = bpf_prog_run(prog, fba);
|
||||
migrate_enable();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* expression statement to wrap the backing filter logic
|
||||
* struct inode *inode: inode with bpf and backing inode
|
||||
@@ -1968,7 +1978,7 @@ ssize_t fuse_bpf_simple_request(struct fuse_mount *fm, struct fuse_bpf_args *arg
|
||||
fa.out_numargs = fa.in_numargs; \
|
||||
\
|
||||
ext_flags = fuse_inode->bpf ? \
|
||||
bpf_prog_run(fuse_inode->bpf, &fa) : \
|
||||
fuse_bpf_run(fuse_inode->bpf, &fa) : \
|
||||
FUSE_BPF_BACKING; \
|
||||
if (ext_flags < 0) { \
|
||||
fer = (struct fuse_err_ret) { \
|
||||
@@ -2023,7 +2033,7 @@ ssize_t fuse_bpf_simple_request(struct fuse_mount *fm, struct fuse_bpf_args *arg
|
||||
.size = fa.out_args[i].size, \
|
||||
.value = fa.out_args[i].value, \
|
||||
}; \
|
||||
ext_flags = bpf_prog_run(fuse_inode->bpf, &fa); \
|
||||
ext_flags = fuse_bpf_run(fuse_inode->bpf, &fa); \
|
||||
if (ext_flags < 0) { \
|
||||
fer = (struct fuse_err_ret) { \
|
||||
ERR_PTR(ext_flags), \
|
||||
|
||||
Reference in New Issue
Block a user