]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
Drivers: hv: vmbus: Fix synic per-cpu context initialization
authorMichael Kelley <mikelley@microsoft.com>
Fri, 10 Aug 2018 23:06:11 +0000 (23:06 +0000)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 26 Nov 2019 12:16:36 +0000 (13:16 +0100)
commit44aa32e7cfca2bbb169cba22dd76d5faa65a716c
tree22526b59a6ad34ab54fe8adf6ce5fcac8ee9af93
parent1b87f8536adc6ea370aea9c6e62f74550f822edb
Drivers: hv: vmbus: Fix synic per-cpu context initialization

BugLink: https://bugs.launchpad.net/bugs/1853915
[ Upstream commit f25a7ece08bdb1f2b3c4bbeae942682fc3a99dde ]

If hv_synic_alloc() errors out, the state of the per-cpu context
for some CPUs is unknown since the zero'ing is done as each
CPU is iterated over.  In such case, hv_synic_cleanup() may try to
free memory based on uninitialized values.  Fix this by zero'ing
the per-cpu context for all CPUs before doing any memory
allocations that might fail.

Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/hv/hv.c