Commit 80737883 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Guo Mengqi
Browse files

uio_hv_generic: Fix a memory leak in error handling paths

stable inclusion
from stable-v5.10.40
commit d84b5e912212b05f6b5bde9f682046accfbe0354
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I956GH
CVE: CVE-2021-47071

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d84b5e912212b05f6b5bde9f682046accfbe0354



--------------------------------

commit 3ee098f9 upstream.

If 'vmbus_establish_gpadl()' fails, the (recv|send)_gpadl will not be
updated and 'hv_uio_cleanup()' in the error handling path will not be
able to free the corresponding buffer.

In such a case, we need to free the buffer explicitly.

Fixes: cdfa835c ("uio_hv_generic: defer opening vmbus until first use")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/4fdaff557deef6f0475d02ba7922ddbaa1ab08a6.1620544055.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarGuo Mengqi <guomengqi3@huawei.com>
parent eac3c6a0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment