Skip to content

Commit

Permalink
[Backport] Android 14: Don't set execute-only on FIPS .text segment (#…
Browse files Browse the repository at this point in the history
…1461)

### Description of changes: 
* Backport to the FIPS branch of: #1460


By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.
  • Loading branch information
justsmth authored Mar 1, 2024
1 parent ef2b9dc commit f5f0c9b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crypto/fipsmodule/bcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ static void assert_not_within(const void *start, const void *symbol,

#if defined(OPENSSL_ANDROID) && defined(OPENSSL_AARCH64)
static void BORINGSSL_maybe_set_module_text_permissions(int permission) {
// TODO: Re-enable once all data has been moved out of .text segments
// CryptoAlg-2360
#if 0
// Android may be compiled in execute-only-memory mode, in which case the
// .text segment cannot be read. That conflicts with the need for a FIPS
// module to hash its own contents, therefore |mprotect| is used to make
Expand All @@ -211,6 +214,7 @@ static void BORINGSSL_maybe_set_module_text_permissions(int permission) {
permission) != 0) {
perror("BoringSSL: mprotect");
}
#endif // 0
}
#endif // !ANDROID

Expand Down

0 comments on commit f5f0c9b

Please sign in to comment.