diff options
| author | Snehal Koukuntla <[email protected]> | 2024-09-09 18:01:54 +0000 |
|---|---|---|
| committer | Marc Zyngier <[email protected]> | 2024-09-10 20:05:29 +0000 |
| commit | f26a525b77e040d584e967369af1e018d2d59112 (patch) | |
| tree | a7dfc9fe7c3df4d9a8130940a82814585e4ca162 /drivers/platform/surface/aggregator/ssh_parser.c | |
| parent | KVM: arm64: Disallow copying MTE to guest memory while KVM is dirty logging (diff) | |
| download | kernel-f26a525b77e040d584e967369af1e018d2d59112.tar.gz kernel-f26a525b77e040d584e967369af1e018d2d59112.zip | |
KVM: arm64: Add memory length checks and remove inline in do_ffa_mem_xfer
When we share memory through FF-A and the description of the buffers
exceeds the size of the mapped buffer, the fragmentation API is used.
The fragmentation API allows specifying chunks of descriptors in subsequent
FF-A fragment calls and no upper limit has been established for this.
The entire memory region transferred is identified by a handle which can be
used to reclaim the transferred memory.
To be able to reclaim the memory, the description of the buffers has to fit
in the ffa_desc_buf.
Add a bounds check on the FF-A sharing path to prevent the memory reclaim
from failing.
Also do_ffa_mem_xfer() does not need __always_inline, except for the
BUILD_BUG_ON() aspect, which gets moved to a macro.
[maz: fixed the BUILD_BUG_ON() breakage with LLVM, thanks to Wei-Lin Chang
for the timely report]
Fixes: 634d90cf0ac65 ("KVM: arm64: Handle FFA_MEM_LEND calls from the host")
Cc: [email protected]
Reviewed-by: Sebastian Ene <[email protected]>
Signed-off-by: Snehal Koukuntla <[email protected]>
Reviewed-by: Oliver Upton <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marc Zyngier <[email protected]>
Diffstat (limited to 'drivers/platform/surface/aggregator/ssh_parser.c')
0 files changed, 0 insertions, 0 deletions
