This is an archive of the discontinued LLVM Phabricator instance.

[lldb][Android] Add platform.plugin.remote-android.package-name
ClosedPublic

Authored by splhack on Jun 14 2023, 9:14 AM.

Details

Summary

When LLDB fails to pull file from a package directory due to security
constraint, user needs to set the package name to
'platform.plugin.remote-android.run-as' property to run shell commands
as the package user. (e.g. to get file with 'cat' and 'dd').

https://cs.android.com/android/platform/superproject/+/master:
system/core/run-as/run-as.cpp;l=39-61;
drc=4a77a84a55522a3b122f9c63ef0d0b8a6a131627

This supersedes D152494
Depends on D152855

Diff Detail

Event Timeline

splhack created this revision.Jun 14 2023, 9:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2023, 9:14 AM
Herald added a subscriber: danielkiss. · View Herald Transcript
splhack published this revision for review.Jun 14 2023, 9:20 AM
splhack added reviewers: clayborg, bulbazord, labath, lanza.
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2023, 9:20 AM
splhack updated this revision to Diff 531398.Jun 14 2023, 9:49 AM

remove 'Depends on' from commit message

splhack updated this revision to Diff 531579.Jun 14 2023, 5:08 PM

Fixed diff dependencies in order to fix CI
https://reviews.llvm.org/B238946

I am wondering if the current proposed setting name "platform.plugin.remote-android.run-as" should actually be "platform.plugin.remote-android. package-name" to be a bit more clear. Not sure if we can use the package name in other places?

What happens if you do run-as with an empty package name?
I'm also not tied to the name "platform.plugin.remote-android.run-as" if others don't like it. platform.plugin.remote-android.package-name is fine too.

@clayborg

platform.plugin.remote-android.package-name

sure, sounds good. will update.

@bulbazord

What happens if you do run-as with an empty package name?

$ adb shell "run-as '' ls"; echo $?
run-as: unknown package:
1

which is the same as when specify non-existing package.

$ adb shell "run-as 'unknown' ls"; echo $?
run-as: unknown package: unknown
1
splhack updated this revision to Diff 532243.Jun 16 2023, 11:16 AM

Rename it to platform.plugin.remote-android.package-name

splhack retitled this revision from [lldb][Android] Add platform.plugin.remote-android.run-as to [lldb][Android] Add platform.plugin.remote-android.package-name.Jun 16 2023, 11:16 AM
splhack updated this revision to Diff 532245.Jun 16 2023, 11:17 AM

update commit message

clayborg accepted this revision.Jun 16 2023, 11:54 AM

lgtm now!

This revision is now accepted and ready to land.Jun 16 2023, 11:54 AM