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: syzbot+d9efec94dcbfa0de1c07@syzkaller.appspotmail.com Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 34e1a5d commit 0c33037

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)