ovl: fix incorrect fdput() on aio completion
stable inclusion from stable-v5.10.197 commit c6422e6f173d760239cd250eb21fb35a43c54936 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I96Q8P Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c6422e6f173d760239cd250eb21fb35a43c54936 -------------------------------- commit 724768a3 upstream. ovl_{read,write}_iter() always call fdput(real) to put one or zero refcounts of the real file, but for aio, whether it was submitted or not, ovl_aio_put() also calls fdput(), which is not balanced. This is only a problem in the less common case when FDPUT_FPUT flag is set. To fix the problem use get_file() to take file refcount and use fput() instead of fdput() in ovl_aio_put(). Fixes: 2406a307 ("ovl: implement async IO routines") Cc: <stable@vger.kernel.org> # v5.6 Reviewed-by:Miklos Szeredi <miklos@szeredi.hu> Signed-off-by:
Amir Goldstein <amir73il@gmail.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment