]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
xen-blkback: fix leak of grant maps on ring setup failure
authorRoger Pau Monné <royger@FreeBSD.org>
Wed, 20 Jan 2021 18:40:51 +0000 (19:40 +0100)
committerRoger Pau Monné <royger@FreeBSD.org>
Mon, 22 Feb 2021 15:47:52 +0000 (16:47 +0100)
commit808d4aad1022a2a33d222663b0c9badde30b9d45
tree37846fa9a3b30eaf226b8b864033ca32f2ef28d6
parentaa8ae5fe17eb380b0f30f1641f17a0b3d83a68c3
xen-blkback: fix leak of grant maps on ring setup failure

Multi page rings are mapped using a single hypercall that gets passed
an array of grants to map. One of the grants in the array failing to
map would lead to the failure of the whole ring setup operation, but
there was no cleanup of the rest of the grant maps in the array that
could have likely been created as a result of the hypercall.

Add proper cleanup on the failure path during ring setup to unmap any
grants that could have been created.

This is part of XSA-361.

Sponsored by: Citrix Systems R&D
sys/dev/xen/blkback/blkback.c