Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit a54787ba authored by Kevin F. Haggerty's avatar Kevin F. Haggerty
Browse files

Merge tag 'android-security-13.0.0_r29' into staging/lineage-20.0_android-security-13.0.0_r29

Android Security 13.0.0 Release 29 (13218412)

* tag 'android-security-13.0.0_r29':
  [vims] better handle assistant force stop
  speech: No BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS
  RESTRICT AUTOMERGE Clear the BAL allowlist duration
  Remove invalid null check for callingPackage
  RESTRICT AUTOMERGE Normalize home intent
  Allow core uids to register receiver as "android".
  Impose a threshold on the number of attributed op entries returned in a binder call
  Add a list of Biometric protected packages
  Don't allow non-system uids to use "android" as calling package.
  Avoid app pinning requests if the Task is already locked

Conflicts:
	core/res/res/values/config.xml
	core/res/res/values/symbols.xml
	services/core/java/com/android/server/wm/ActivityStartInterceptor.java
	services/core/java/com/android/server/wm/ActivityStarter.java

Change-Id: I65d45cd087a9ffd4063a8aeb756adae6171c4e7c
parents 263b97c8 08b79623
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -6140,4 +6140,8 @@
    <!-- Whether we should persist the brightness value in nits for the default display even if
         the underlying display device changes. -->
    <bool name="config_persistBrightnessNitsForDefaultDisplay">false</bool>

    <!-- List of protected packages that require biometric authentication for modification
         (Disable, force-stop or uninstalling updates). -->
    <string-array name="config_biometric_protected_package_names" translatable="false" />
</resources>
+4 −0
Original line number Diff line number Diff line
@@ -4916,4 +4916,8 @@

  <!-- Whether to show weather on the lockscreen by default. -->
  <java-symbol type="bool" name="config_lockscreenWeatherEnabledByDefault" />

  <!-- List of protected packages that require biometric authentication for modification -->
  <java-symbol type="array" name="config_biometric_protected_package_names" />

</resources>
+11 −9
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageInstaller;
import android.content.pm.PackageInstaller.SessionInfo;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.net.Uri;
@@ -67,14 +68,15 @@ public class InstallStart extends Activity {
        // If the activity was started via a PackageInstaller session, we retrieve the calling
        // package from that session
        final int sessionId = (isSessionInstall
                ? intent.getIntExtra(PackageInstaller.EXTRA_SESSION_ID, -1)
                : -1);
        if (callingPackage == null && sessionId != -1) {
            PackageInstaller packageInstaller = getPackageManager().getPackageInstaller();
                ? intent.getIntExtra(PackageInstaller.EXTRA_SESSION_ID, SessionInfo.INVALID_ID)
                : SessionInfo.INVALID_ID);
        if (sessionId != SessionInfo.INVALID_ID) {
            PackageInstaller packageInstaller = mPackageManager.getPackageInstaller();
            PackageInstaller.SessionInfo sessionInfo = packageInstaller.getSessionInfo(sessionId);
            callingPackage = (sessionInfo != null) ? sessionInfo.getInstallerPackageName() : null;
            callingAttributionTag =
                    (sessionInfo != null) ? sessionInfo.getInstallerAttributionTag() : null;
            if (sessionInfo != null) {
                callingPackage = sessionInfo.getInstallerPackageName();
                callingAttributionTag = sessionInfo.getInstallerAttributionTag();
            }
        }

        final ApplicationInfo sourceInfo = getSourceInfo(callingPackage);
@@ -191,7 +193,7 @@ public class InstallStart extends Activity {
    private ApplicationInfo getSourceInfo(@Nullable String callingPackage) {
        if (callingPackage != null) {
            try {
                return getPackageManager().getApplicationInfo(callingPackage, 0);
                return mPackageManager.getApplicationInfo(callingPackage, 0);
            } catch (PackageManager.NameNotFoundException ex) {
                // ignore
            }
@@ -238,7 +240,7 @@ public class InstallStart extends Activity {
    }

    private boolean isSystemDownloadsProvider(int uid) {
        final ProviderInfo downloadProviderPackage = getPackageManager().resolveContentProvider(
        final ProviderInfo downloadProviderPackage = mPackageManager.resolveContentProvider(
                DOWNLOADS_AUTHORITY, 0);
        if (downloadProviderPackage == null) {
            // There seems to be no currently enabled downloads provider on the system.
+2 −3
Original line number Diff line number Diff line
@@ -13194,9 +13194,8 @@ public class ActivityManagerService extends IActivityManager.Stub
                            + " (pid=" + Binder.getCallingPid()
                            + ") when registering receiver " + receiver);
                }
                if (callerApp.info.uid != SYSTEM_UID
                        && !callerApp.getPkgList().containsKey(callerPackage)
                        && !"android".equals(callerPackage)) {
                if (!UserHandle.isCore(callerApp.info.uid)
                        && !callerApp.getPkgList().containsKey(callerPackage)) {
                    throw new SecurityException("Given caller package " + callerPackage
                            + " is not running in process " + callerApp);
                }
+19 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package com.android.server.am;

import static android.app.ActivityManager.START_SUCCESS;
import static android.os.PowerWhitelistManager.TEMPORARY_ALLOWLIST_TYPE_FOREGROUND_SERVICE_ALLOWED;
import static android.os.PowerWhitelistManager.TEMPORARY_ALLOWLIST_TYPE_FOREGROUND_SERVICE_NOT_ALLOWED;

import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_BROADCAST_LIGHT;
import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
@@ -45,6 +47,7 @@ import android.util.ArraySet;
import android.util.Slog;
import android.util.TimeUtils;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.os.IResultReceiver;
import com.android.internal.util.function.pooled.PooledLambda;
import com.android.server.wm.SafeActivityOptions;
@@ -257,6 +260,10 @@ public final class PendingIntentRecord extends IIntentSender.Stub {
        this.stringName = null;
    }

    @VisibleForTesting TempAllowListDuration getAllowlistDurationLocked(IBinder allowlistToken) {
        return mAllowlistDuration.get(allowlistToken);
    }

    void setAllowBgActivityStarts(IBinder token, int flags) {
        if (token == null) return;
        if ((flags & FLAG_ACTIVITY_SENDER) != 0) {
@@ -275,6 +282,13 @@ public final class PendingIntentRecord extends IIntentSender.Stub {
        mAllowBgActivityStartsForActivitySender.remove(token);
        mAllowBgActivityStartsForBroadcastSender.remove(token);
        mAllowBgActivityStartsForServiceSender.remove(token);
        if (mAllowlistDuration != null) {
            TempAllowListDuration duration = mAllowlistDuration.get(token);
            if (duration != null
                    && duration.type == TEMPORARY_ALLOWLIST_TYPE_FOREGROUND_SERVICE_ALLOWED) {
                duration.type = TEMPORARY_ALLOWLIST_TYPE_FOREGROUND_SERVICE_NOT_ALLOWED;
            }
        }
    }

    public void registerCancelListenerLocked(IResultReceiver receiver) {
@@ -569,6 +583,11 @@ public final class PendingIntentRecord extends IIntentSender.Stub {
        return res;
    }

    @VisibleForTesting boolean getBackgroundStartPrivilegesForActivitySender(
            IBinder allowlistToken) {
        return mAllowBgActivityStartsForActivitySender.contains(allowlistToken);
    }

    @Override
    protected void finalize() throws Throwable {
        try {
Loading