提交 d46fec38 编写于 作者: J Jan Beulich 提交者: Cheng Jian

xen-blkback: don't leak persistent grants from xen_blkbk_map()

stable inclusion
from linux-4.19.184
commit 16356ddb587867c2a5ab85407eeb75f2b8818207
CVE: CVE-2021-28688

--------------------------------

commit a846738f 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: NJan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: NJuergen Gross <jgross@suse.com>
Reviewed-by: NWei Liu <wl@xen.org>
Signed-off-by: NJuergen Gross <jgross@suse.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 457eaaad
...@@ -944,7 +944,7 @@ static int xen_blkbk_map(struct xen_blkif_ring *ring, ...@@ -944,7 +944,7 @@ static int xen_blkbk_map(struct xen_blkif_ring *ring,
out: out:
for (i = last_map; i < num; i++) { for (i = last_map; i < num; i++) {
/* Don't zap current batch's valid persistent grants. */ /* Don't zap current batch's valid persistent grants. */
if(i >= last_map + segs_to_map) if(i >= map_until)
pages[i]->persistent_gnt = NULL; pages[i]->persistent_gnt = NULL;
pages[i]->handle = BLKBACK_INVALID_HANDLE; pages[i]->handle = BLKBACK_INVALID_HANDLE;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册