Skip to content

Commit 3a1ca9b

Browse files
jbeulichgregkh
authored andcommitted
xen-blkback: don't leak persistent grants from xen_blkbk_map()
commit a846738 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>
1 parent 03a1c32 commit 3a1ca9b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/block/xen-blkback/blkback.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ static int xen_blkbk_map(struct xen_blkif_ring *ring,
891891
out:
892892
for (i = last_map; i < num; i++) {
893893
/* Don't zap current batch's valid persistent grants. */
894-
if(i >= last_map + segs_to_map)
894+
if(i >= map_until)
895895
pages[i]->persistent_gnt = NULL;
896896
pages[i]->handle = BLKBACK_INVALID_HANDLE;
897897
}

0 commit comments

Comments
 (0)