All of lore.kernel.org
 help / color / mirror / Atom feed
* update_runstate_area and Linux KPTI
@ 2018-03-02 15:57 Julien Grall
  2018-03-02 16:04 ` Andrew Cooper
  0 siblings, 1 reply; 12+ messages in thread
From: Julien Grall @ 2018-03-02 15:57 UTC (permalink / raw)
  To: xen-devel, Juergen Gross, Boris Ostrovsky, Jan Beulich,
	osstest service owner, Andrew Cooper

Hi,

While I was looking at some unrelated problem with Xen ARM P2M code, I 
noticed that the function update_runstate_area is using guest virtual 
address to update the vCPU runstate. That function will be called when 
context switch to a vCPU. However, that vCPU may run in userspace 
context. When KPTI (kernel page table isolation) is used,

In the best case, that address is not mapped into the page-table 
currently used. Xen will not be able to update the region.

In the worst case, that address is mapped to a different region and Xen 
will corrupt some bits of the memory.

The code looks fundamentally wrong on Arm, I am entirely not sure about x86.

It look like to me that Xen should always use the guest physical address 
and therefore translate the virtual address to a physical one in 
VCPUOP_register_runstate_memory_area. So only the physical address will 
be used in update_runstate_area making the function much safer.

Any opinion on this approach?

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-03-11 19:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-02 15:57 update_runstate_area and Linux KPTI Julien Grall
2018-03-02 16:04 ` Andrew Cooper
2018-03-02 16:18   ` Jan Beulich
2018-03-02 16:23     ` Andrew Cooper
2018-03-02 16:25     ` Julien Grall
2018-03-02 16:51       ` Jan Beulich
2018-03-02 16:56       ` Juergen Gross
     [not found]       ` <5A998F0502000078001AE011@suse.com>
2018-03-02 17:05         ` Juergen Gross
2018-03-02 17:09           ` Andrew Cooper
2018-03-02 17:25             ` Juergen Gross
2018-03-11 19:29               ` Julien Grall
2018-03-11 19:21             ` Julien Grall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.