Commit 2485db22 authored by Pierre-Clément Tosi's avatar Pierre-Clément Tosi
Browse files

ANDROID: KVM: arm64: Add __pkvm_module_{memcpy,memset}()



pKVM modules built with KCFI checks would fail when calling
module_ops->memcpy(...) or module_ops->memset(...) as those directly
point to the arch implementations (within the core kernel) which are not
declared with SYM_TYPED_START() i.e. don't have the KCFI u32 type id
prefix.

Therefore, expose these in the module_ops using C wrappers (which the
compiler will properly decorate) so that KCFI checks in modules pass.

This adds an extra level of indirection when calling the functions,
which could be avoided by decorating the asm routines, similar to

 commit c50d3285 ("arm64: Add types to indirect called assembly
                       functions")
 commit b952a9cf ("crypto: arm64/aes-neonbs - fix crash with CFI
                       enabled"))
 commit ccace936 ("x86: Add types to indirectly called assembly
                       functions")

but, given that the issue only concerns pKVM modules (not yet supported
upstream), prefer a pKVM-only solution.

Bug: 278010198
Bug: 278749606
Change-Id: I0d241755ae7980b454fce2cef98a3f0bf7c22263
Signed-off-by: default avatarPierre-Clément Tosi <ptosi@google.com>
parent 6368f8d4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment