Skip to content

Commit 0c33037

Browse files
amir73iltorvalds
authored andcommitted
ovl: fix file leak in ovl_real_fdget_meta()
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]>
1 parent 34e1a5d commit 0c33037

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/overlayfs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static int ovl_real_fdget_meta(const struct file *file, struct fd *real,
117117
struct file *f = ovl_open_realfile(file, &realpath);
118118
if (IS_ERR(f))
119119
return PTR_ERR(f);
120-
real->word = (unsigned long)ovl_open_realfile(file, &realpath) | FDPUT_FPUT;
120+
real->word = (unsigned long)f | FDPUT_FPUT;
121121
return 0;
122122
}
123123

0 commit comments

Comments
 (0)