xen-blkback: don't leak persistent grants from xen_blkbk_map()
authorJan Beulich <jbeulich@suse.com>
Fri, 26 Mar 2021 15:28:57 +0000 (16:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Mar 2021 12:41:43 +0000 (14:41 +0200)
commit3cb86952ce3c8b28a0c1f3ce82848618d8628015
tree33bdb59890224e536597b222a236dc9ff4749555
parentfffbb8528930f34c5a9b9e3562de0167a5377d52
xen-blkback: don't leak persistent grants from xen_blkbk_map()

commit a846738f8c3788d846ed1f587270d2f2e3d32432 upstream.

The fix for XSA-365 zapped too many of the ->persistent_gnt[] entries.
Ones successfully obtained should not be overwritten, but instead left
for xen_blkbk_unmap_prepare() to pick up and put.

This is XSA-371.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wl@xen.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/xen-blkback/blkback.c