Last active
February 11, 2019 14:32
-
-
Save phstudy/2c23609731578a941e2847aed1ccfc04 to your computer and use it in GitHub Desktop.
revert CVE-2017-0489 for mock location detection (Android 2017-03-01 security patch)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/services/core/java/com/android/server/LocationManagerService.java b/services/core/java/com/android/server/LocationManagerService.java | |
index 7b02a4fb3fd..04006c36e5a 100644 | |
--- a/services/core/java/com/android/server/LocationManagerService.java | |
+++ b/services/core/java/com/android/server/LocationManagerService.java | |
@@ -73,7 +73,6 @@ import android.provider.Settings; | |
import android.text.TextUtils; | |
import android.util.ArrayMap; | |
import android.util.ArraySet; | |
-import android.util.EventLog; | |
import android.util.Log; | |
import android.util.Slog; | |
import com.android.internal.content.PackageMonitor; | |
@@ -3250,21 +3249,9 @@ public class LocationManagerService extends ILocationManager.Stub { | |
throw new IllegalArgumentException("Provider \"" + provider + "\" unknown"); | |
} | |
- // Ensure that the location is marked as being mock. There's some logic to do this in | |
- // handleLocationChanged(), but it fails if loc has the wrong provider (bug 33091107). | |
- Location mock = new Location(loc); | |
- mock.setIsFromMockProvider(true); | |
- | |
- if (!TextUtils.isEmpty(loc.getProvider()) && !provider.equals(loc.getProvider())) { | |
- // The location has an explicit provider that is different from the mock provider | |
- // name. The caller may be trying to fool us via bug 33091107. | |
- EventLog.writeEvent(0x534e4554, "33091107", Binder.getCallingUid(), | |
- provider + "!=" + loc.getProvider()); | |
- } | |
- | |
// clear calling identity so INSTALL_LOCATION_PROVIDER permission is not required | |
long identity = Binder.clearCallingIdentity(); | |
- mockProvider.setLocation(mock); | |
+ mockProvider.setLocation(loc); | |
Binder.restoreCallingIdentity(identity); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment