From 4f1644e029bddd02b633c4f66801b73c26316361 Mon Sep 17 00:00:00 2001 From: Charles He Date: Thu, 1 Dec 2016 19:22:33 +0000 Subject: Add @GuardedBy annotation to PersistentDataBlockService#mIsWritable. Test: manual Bug: 30352311 CVE-2017-0498 Change-Id: I1024f2a56badde5c123d025d6fe02f42559cbcb1 (cherry picked from commit f6f1d627483b4dad9d65176769a1ee92c59a4810) (cherry picked from commit 71d2a41dd9c8be8c4bca5eba339802e1e0c2be3c) (cherry picked from commit 5f621b5b1549e8379aee05807652d5111382ccc6) --- services/core/java/com/android/server/PersistentDataBlockService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/core/java/com/android/server/PersistentDataBlockService.java b/services/core/java/com/android/server/PersistentDataBlockService.java index 32b183b..9346083 100644 --- a/services/core/java/com/android/server/PersistentDataBlockService.java +++ b/services/core/java/com/android/server/PersistentDataBlockService.java @@ -29,6 +29,7 @@ import android.service.persistentdata.IPersistentDataBlockService; import android.util.Slog; import com.android.internal.R; +import com.android.internal.annotations.GuardedBy; import libcore.io.IoUtils; @@ -77,6 +78,8 @@ public class PersistentDataBlockService extends SystemService { private int mAllowedUid = -1; private long mBlockDeviceSize; + + @GuardedBy("mLock") private boolean mIsWritable = true; public PersistentDataBlockService(Context context) { -- cgit v1.1