xen/arm: call uaccess_ttbr0_enable for dm_op hypercall
authorStefano Stabellini <stefano.stabellini@amd.com>
Mon, 12 May 2025 21:54:52 +0000 (14:54 -0700)
committerJuergen Gross <jgross@suse.com>
Fri, 23 May 2025 05:10:02 +0000 (07:10 +0200)
commit7f9bbc1140ff8796230bc2634055763e271fd692
tree52b3363e8b58703d7d7ac15cfdf846030e07c599
parent74287971dbb3fe322bb316afd9e7fb5807e23bee
xen/arm: call uaccess_ttbr0_enable for dm_op hypercall

dm_op hypercalls might come from userspace and pass memory addresses as
parameters. The memory addresses typically correspond to buffers
allocated in userspace to hold extra hypercall parameters.

On ARM, when CONFIG_ARM64_SW_TTBR0_PAN is enabled, they might not be
accessible by Xen, as a result ioreq hypercalls might fail. See the
existing comment in arch/arm64/xen/hypercall.S regarding privcmd_call
for reference.

For privcmd_call, Linux calls uaccess_ttbr0_enable before issuing the
hypercall thanks to commit 9cf09d68b89a. We need to do the same for
dm_op. This resolves the problem.

Cc: stable@kernel.org
Fixes: 9cf09d68b89a ("arm64: xen: Enable user access before a privcmd hvc call")
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Message-ID: <alpine.DEB.2.22.394.2505121446370.8380@ubuntu-linux-20-04-desktop>
Signed-off-by: Juergen Gross <jgross@suse.com>
arch/arm64/xen/hypercall.S