• Jérôme Glisse's avatar
    cifs: fix page reference leak with readv/writev · 13f5938d
    Jérôme Glisse authored
    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: default avatarJé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: default avatarSteve French <stfrench@microsoft.com>
    Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
    13f5938d
misc.c 26.8 KB