mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
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: Sami Tolvanen <samitolvanen@google.com>
This commit is contained in:
committed by
Alistair Strachan
parent
8c9fc78531
commit
59dec11636
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user