webview: make relro load failure a warning.

Failing to open the relro file when loading WebView isn't a major
problem (we can still load the library, it just loses a RAM
optimization), and can happen in some edge cases like when the current
address space reservation was not large enough to create the file.

The other messages logged from Java about this are at warning level;
make this native error also a warning. The other errors in this function
are entirely unexpected conditions, so leave them as errors.

Fixes: 197972345
Test: n/a
Change-Id: Iaf0d4a3b6e42ba93ef6782b5b9120cd69cae3002
This commit is contained in:
Torne (Richard Coles)
2021-09-14 14:14:06 -04:00
parent 0a25520f9b
commit ddd332f72b

View File

@@ -121,8 +121,8 @@ jint DoLoadWithRelroFile(JNIEnv* env, const char* lib, const char* relro,
jobject clazzLoader) {
int relro_fd = TEMP_FAILURE_RETRY(open(relro, O_RDONLY));
if (relro_fd == -1) {
ALOGE("Failed to open relro file %s: %s", relro, strerror(errno));
return LIBLOAD_FAILED_TO_OPEN_RELRO_FILE;
ALOGW("Failed to open relro file %s: %s", relro, strerror(errno));
return LIBLOAD_FAILED_TO_OPEN_RELRO_FILE;
}
android_namespace_t* ns =
android::FindNamespaceByClassLoader(env, clazzLoader);