Commit 654f209
Filter and check hypercalls from userspace
Xen cannot determine whether a hypercall originates from userspace or kernel
space. A malicious userspace may use Xen to attack the dom0 kernel.
To avoid this, instead of allowing all hypercalls verbatim, block all
hypercalls by default. Allow through certain hypercalls with checks.
Checking involves:
1) Any pointers need to point at valid userspace memory. For this, we also need
to know the size of the buffer.
2) Buffers containing pointers need to be bounced to avoid userspace changing
the memory after it has been checked. After the hypercall completes, the
memory needs to be bounced back.
In addition, for the kexec_load call, verify the kernel to maintain Secure Boot
integrity.
This patch is technical debt and should be replaced by a stable hypervisor ABI
and a generic mechanism for the dom0 kernel to check hypercalls made from
userspace.
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
[ Corentin: rebase from XS-9 kernel (v6.6.98 based) to UEK8 kernel (v6.12 based):
- 260017f `("lsm: use default hook return value in call_int_hook()") simplified the `call_int_hook`
macro, so align our usage in `security_locked_down_nowarn()`]1 parent 434f17a commit 654f209
11 files changed
Lines changed: 1490 additions & 5 deletions
File tree
- drivers
- pci
- xen
- xen-pciback
- include/linux
- security
- lockdown
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5458 | 5458 | | |
5459 | 5459 | | |
5460 | 5460 | | |
| 5461 | + | |
| 5462 | + | |
5461 | 5463 | | |
5462 | 5464 | | |
5463 | 5465 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
0 commit comments