ANDROID: arch/arm64/crypto: fix CFI in SHA CE
Add C wrappers to allow indirect calls to sha[12]_ce_transform without tripping CFI. Bug: 67506682 Change-Id: If872f30095994206bc768eee13670be552b2a247 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
This commit is contained in:
parent
9fb487de4f
commit
2eea7764ef
2 changed files with 16 additions and 0 deletions
arch/arm64/crypto
|
@ -29,6 +29,14 @@ struct sha1_ce_state {
|
|||
|
||||
asmlinkage void sha1_ce_transform(struct sha1_ce_state *sst, u8 const *src,
|
||||
int blocks);
|
||||
#ifdef CONFIG_CFI_CLANG
|
||||
static inline void __cfi_sha1_ce_transform(struct sha1_state *sst,
|
||||
u8 const *src, int blocks)
|
||||
{
|
||||
sha1_ce_transform((struct sha1_ce_state *)sst, src, blocks);
|
||||
}
|
||||
#define sha1_ce_transform __cfi_sha1_ce_transform
|
||||
#endif
|
||||
|
||||
const u32 sha1_ce_offsetof_count = offsetof(struct sha1_ce_state, sst.count);
|
||||
const u32 sha1_ce_offsetof_finalize = offsetof(struct sha1_ce_state, finalize);
|
||||
|
|
|
@ -29,6 +29,14 @@ struct sha256_ce_state {
|
|||
|
||||
asmlinkage void sha2_ce_transform(struct sha256_ce_state *sst, u8 const *src,
|
||||
int blocks);
|
||||
#ifdef CONFIG_CFI_CLANG
|
||||
static inline void __cfi_sha2_ce_transform(struct sha256_state *sst,
|
||||
u8 const *src, int blocks)
|
||||
{
|
||||
sha2_ce_transform((struct sha256_ce_state *)sst, src, blocks);
|
||||
}
|
||||
#define sha2_ce_transform __cfi_sha2_ce_transform
|
||||
#endif
|
||||
|
||||
const u32 sha256_ce_offsetof_count = offsetof(struct sha256_ce_state,
|
||||
sst.count);
|
||||
|
|
Loading…
Add table
Reference in a new issue