]> 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)
committerMark Johnston <markj@FreeBSD.org>
Wed, 24 Feb 2021 01:42:35 +0000 (20:42 -0500)
commitce9af53d0897a1cb926bd244f499fc09b1626b27
tree6eccf2c6d38336b25a58e65a97c6911196d95fb3
parent4b737a9c58cac69008f189cc44e7d1a81a0b601c
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.

Approved by: re (implicit, so)
Approved by: so
Security: CVE-2021-26932
Security: FreeBSD-SA-21:06.xen
Security: XSA-361
Sponsored by: Citrix Systems R&D

(cherry picked from commit 808d4aad1022a2a33d222663b0c9badde30b9d45)
(cherry picked from commit ab3e1bd3c22a222520c23c2793cc39e3a23c9b46)
sys/dev/xen/blkback/blkback.c