Skip to content

Commit 8542f17

Browse files
committed
ovl: fix file reference leak when submitting aio
Commit 724768a ("ovl: fix incorrect fdput() on aio completion") took a refcount on real file before submitting aio, but forgot to avoid clearing FDPUT_FPUT from real.flags stack variable. This can result in a file reference leak. Fixes: 724768a ("ovl: fix incorrect fdput() on aio completion") Reported-by: Gil Lev <[email protected]> Signed-off-by: Amir Goldstein <[email protected]>
1 parent 8a749fd commit 8542f17

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

fs/overlayfs/file.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *iter)
341341
if (!aio_req)
342342
goto out;
343343

344-
real.flags = 0;
345344
aio_req->orig_iocb = iocb;
346345
kiocb_clone(&aio_req->iocb, iocb, get_file(real.file));
347346
aio_req->iocb.ki_complete = ovl_aio_rw_complete;
@@ -413,7 +412,6 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter)
413412
if (!aio_req)
414413
goto out;
415414

416-
real.flags = 0;
417415
aio_req->orig_iocb = iocb;
418416
kiocb_clone(&aio_req->iocb, iocb, get_file(real.file));
419417
aio_req->iocb.ki_flags = ifl;

0 commit comments

Comments
 (0)