mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
api: disallow virConnect*HypervisorCPU on read-only connections
These APIs can be used to execute arbitrary emulators.
Forbid them on read-only connections.
Fixes: CVE-2019-10168
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit bf6c2830b6
)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
58f237d696
commit
1ef98539a6
@ -1041,6 +1041,7 @@ virConnectCompareHypervisorCPU(virConnectPtr conn,
|
|||||||
|
|
||||||
virCheckConnectReturn(conn, VIR_CPU_COMPARE_ERROR);
|
virCheckConnectReturn(conn, VIR_CPU_COMPARE_ERROR);
|
||||||
virCheckNonNullArgGoto(xmlCPU, error);
|
virCheckNonNullArgGoto(xmlCPU, error);
|
||||||
|
virCheckReadOnlyGoto(conn->flags, error);
|
||||||
|
|
||||||
if (conn->driver->connectCompareHypervisorCPU) {
|
if (conn->driver->connectCompareHypervisorCPU) {
|
||||||
int ret;
|
int ret;
|
||||||
@ -1234,6 +1235,7 @@ virConnectBaselineHypervisorCPU(virConnectPtr conn,
|
|||||||
|
|
||||||
virCheckConnectReturn(conn, NULL);
|
virCheckConnectReturn(conn, NULL);
|
||||||
virCheckNonNullArgGoto(xmlCPUs, error);
|
virCheckNonNullArgGoto(xmlCPUs, error);
|
||||||
|
virCheckReadOnlyGoto(conn->flags, error);
|
||||||
|
|
||||||
if (conn->driver->connectBaselineHypervisorCPU) {
|
if (conn->driver->connectBaselineHypervisorCPU) {
|
||||||
char *cpu;
|
char *cpu;
|
||||||
|
Loading…
Reference in New Issue
Block a user