2019-04-28 00:05:10 +08:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Yonghua Huang <yonghua.huang@intel.com>
|
|
|
|
Date: Tue, 23 Apr 2019 01:34:01 +0800
|
|
|
|
Subject: [PATCH] fix possible nulll pointer dereference in ACRN VHM
|
|
|
|
|
|
|
|
Null pointer dereference will happen if 'vm' is null
|
|
|
|
in acrn_ioreq_get_reqbuf().
|
|
|
|
|
|
|
|
Tracked-On: projectacrn/acrn-hypervisor#1479
|
|
|
|
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
|
|
|
|
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
|
|
|
|
Tracked-On: PKT-2115
|
|
|
|
---
|
|
|
|
drivers/vhm/vhm_ioreq.c | 1 +
|
|
|
|
1 file changed, 1 insertion(+)
|
|
|
|
|
|
|
|
diff --git a/drivers/vhm/vhm_ioreq.c b/drivers/vhm/vhm_ioreq.c
|
2020-05-05 09:02:46 +08:00
|
|
|
index 3647d1ef1..9deb72006 100644
|
2019-04-28 00:05:10 +08:00
|
|
|
--- a/drivers/vhm/vhm_ioreq.c
|
|
|
|
+++ b/drivers/vhm/vhm_ioreq.c
|
|
|
|
@@ -547,6 +547,7 @@ struct vhm_request *acrn_ioreq_get_reqbuf(int client_id)
|
|
|
|
if (unlikely(vm == NULL || vm->req_buf == NULL)) {
|
|
|
|
pr_warn("vhm-ioreq: the req buf page not ready yet "
|
|
|
|
"for vmid %ld\n", client->vmid);
|
|
|
|
+ return NULL;
|
|
|
|
}
|
|
|
|
acrn_ioreq_put_client(client);
|
|
|
|
return (struct vhm_request *)vm->req_buf;
|
|
|
|
--
|
|
|
|
https://clearlinux.org
|
|
|
|
|