Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59dec116 authored by Sami Tolvanen's avatar Sami Tolvanen Committed by Alistair Strachan
Browse files

ANDROID: crypto: arm64/ghash: fix CFI for GHASH CE



Calling a stand-alone assembly function trips clang's Control-Flow
Integrity checking. Add a static inline stub to convert indirect calls
to direct calls for pmull_ghash_update_p(64|8).

Bug: 133186739
Change-Id: Ib4899cdae60d83961f78ed3451a919f7c9c713bc
Signed-off-by: default avatarSami Tolvanen <samitolvanen@google.com>
parent 8c9fc785
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -60,6 +60,22 @@ asmlinkage void pmull_ghash_update_p8(int blocks, u64 dg[], const char *src,
				      struct ghash_key const *k,
				      const char *head);

#ifdef CONFIG_CFI_CLANG
static inline void __cfi_pmull_ghash_update_p64(int blocks, u64 dg[],
                const char *src, struct ghash_key const *k, const char *head)
{
        return pmull_ghash_update_p64(blocks, dg, src, k, head);
}
#define pmull_ghash_update_p64 __cfi_pmull_ghash_update_p64

static inline void __cfi_pmull_ghash_update_p8(int blocks, u64 dg[],
                const char *src, struct ghash_key const *k, const char *head)
{
        return pmull_ghash_update_p8(blocks, dg, src, k, head);
}
#define pmull_ghash_update_p8 __cfi_pmull_ghash_update_p8
#endif

static void (*pmull_ghash_update)(int blocks, u64 dg[], const char *src,
				  struct ghash_key const *k,
				  const char *head);