]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cifs: fix page reference leak with readv/writev
authorJérôme Glisse <jglisse@redhat.com>
Wed, 10 Apr 2019 19:37:47 +0000 (15:37 -0400)
committerSteve French <stfrench@microsoft.com>
Wed, 24 Apr 2019 17:33:59 +0000 (12:33 -0500)
commit13f5938d8264b5501368523c4513ff26608a33e8
treec69e1c167cebb240986c2f079d3f989e7d23e033
parent652727bbe1b17993636346716ae5867627793647
cifs: fix page reference leak with readv/writev

CIFS can leak pages reference gotten through GUP (get_user_pages*()
through iov_iter_get_pages()). This happen if cifs_send_async_read()
or cifs_write_from_iter() calls fail from within __cifs_readv() and
__cifs_writev() respectively. This patch move page unreference to
cifs_aio_ctx_release() which will happens on all code paths this is
all simpler to follow for correctness.

Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
Cc: Steve French <sfrench@samba.org>
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
fs/cifs/file.c
fs/cifs/misc.c