Skip to content

Commit

Permalink
ovl: fix file leak in ovl_real_fdget_meta()
Browse files Browse the repository at this point in the history
ovl_open_realfile() is wrongly called twice after conversion to
new struct fd.

Fixes: 88a2f64 ("struct fd: representation change")
Reported-by: [email protected]
Signed-off-by: Amir Goldstein <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
amir73il authored and torvalds committed Sep 27, 2024
1 parent 34e1a5d commit 0c33037
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/overlayfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static int ovl_real_fdget_meta(const struct file *file, struct fd *real,
struct file *f = ovl_open_realfile(file, &realpath);
if (IS_ERR(f))
return PTR_ERR(f);
real->word = (unsigned long)ovl_open_realfile(file, &realpath) | FDPUT_FPUT;
real->word = (unsigned long)f | FDPUT_FPUT;
return 0;
}

Expand Down

0 comments on commit 0c33037

Please sign in to comment.