diff options
Diffstat (limited to 'resolv/res_cache.cpp')
-rw-r--r-- | resolv/res_cache.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/resolv/res_cache.cpp b/resolv/res_cache.cpp index d6f0cd80..879ddbb4 100644 --- a/resolv/res_cache.cpp +++ b/resolv/res_cache.cpp @@ -1423,7 +1423,9 @@ ResolvCacheStatus _resolv_cache_lookup(unsigned netid, const void* query, int qu // possible to cache the answer of this query. // If ANDROID_RESOLV_NO_CACHE_STORE is set, return RESOLV_CACHE_SKIP to skip possible cache // storing. - if (flags & ANDROID_RESOLV_NO_CACHE_LOOKUP) { + // (b/150371903): ANDROID_RESOLV_NO_CACHE_STORE should imply ANDROID_RESOLV_NO_CACHE_LOOKUP + // to avoid side channel attack. + if (flags & (ANDROID_RESOLV_NO_CACHE_LOOKUP | ANDROID_RESOLV_NO_CACHE_STORE)) { return flags & ANDROID_RESOLV_NO_CACHE_STORE ? RESOLV_CACHE_SKIP : RESOLV_CACHE_NOTFOUND; } Entry key; @@ -1456,11 +1458,6 @@ ResolvCacheStatus _resolv_cache_lookup(unsigned netid, const void* query, int qu if (e == NULL) { LOG(INFO) << __func__ << ": NOT IN CACHE"; - // If it is no-cache-store mode, we won't wait for possible query. - if (flags & ANDROID_RESOLV_NO_CACHE_STORE) { - return RESOLV_CACHE_SKIP; - } - if (!cache_has_pending_request_locked(cache, &key, true)) { return RESOLV_CACHE_NOTFOUND; |