HomeFreeBSD

xen-blkback: fix leak of grant maps on ring setup failure

Description

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: so
Security: CVE-2021-26932
Security: FreeBSD-SA-21:06.xen
Sponsored by: Citrix Systems R&D

(cherry picked from commit 808d4aad1022a2a33d222663b0c9badde30b9d45)
(cherry picked from commit 89238773a37f4fc8f0bf3ccca3aa03874478f194)

Details

Provenance
roygerAuthored on Jan 20 2021, 6:40 PM
markjCommitted on Feb 24 2021, 1:34 AM
Parents
rG2ca137b4306d: MFC freebsd-update: unconditionally regenerate passwd/login.conf files
Branches
Unknown
Tags
Unknown