Skip to content

Commit

Permalink
ANDROID: fuse-bpf: Add NULL pointer check in fuse_release_in
Browse files Browse the repository at this point in the history
If open request sent to classic fuse, backing_file is null.
In fuse_release_initialize, fput will trigger a crash.

Bug: 297831741
Signed-off-by: liujing40 <[email protected]>
(cherry picked from https://android-review.googlesource.com/q/commit:4d2ff573981f06ba09e1ddda8726bb73ff6a2c3f)
Merged-In: I2d54d99d62b54c39a6dc9064f8f62488433aff6f
Change-Id: I2d54d99d62b54c39a6dc9064f8f62488433aff6f
  • Loading branch information
liujing40 authored and bengris32 committed Jun 22, 2024
1 parent 29f7311 commit 89cf325
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/fuse/backing.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,9 @@ int fuse_release_initialize(struct fuse_bpf_args *fa, struct fuse_release_in *fr
struct inode *inode, struct fuse_file *ff)
{
/* Always put backing file whatever bpf/userspace says */
fput(ff->backing_file);
if (ff->backing_file) {
fput(ff->backing_file);
}

*fri = (struct fuse_release_in) {
.fh = ff->fh,
Expand Down

0 comments on commit 89cf325

Please sign in to comment.