sched: don't let XEN_RUNSTATE_UPDATE leak into vcpu_runstate_get()
authorJuergen Gross <jgross@suse.com>
Fri, 25 Oct 2019 09:59:00 +0000 (11:59 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 25 Oct 2019 09:59:00 +0000 (11:59 +0200)
commit6e63afef94ad3f165d71f9271d3daf219f1e6694
tree82c1c2333eaad8d44f9c18cd852ce05ff03267e1
parent5fcaaaed7b163e7806fec2080fa0714743e63692
sched: don't let XEN_RUNSTATE_UPDATE leak into vcpu_runstate_get()

vcpu_runstate_get() should never return a state entry time with
XEN_RUNSTATE_UPDATE set. To avoid this let update_runstate_area()
operate on a local runstate copy.

As it is required to first set the XEN_RUNSTATE_UPDATE indicator in
guest memory, then update all the runstate data, and then at last
clear the XEN_RUNSTATE_UPDATE again it is much less effort to have
a local copy of the runstate data instead of keeping only a copy of
state_entry_time.

This problem was introduced with commit 2529c850ea48f036 ("add update
indicator to vcpu_runstate_info").

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <julien.grall@arm.com>
master commit: f28c4c4c10bdacb1e49cc6e9de57eb1f973cbdf6
master date: 2019-09-26 18:04:09 +0200
xen/arch/arm/domain.c
xen/arch/x86/domain.c