Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
disallow executing app data for the base system and add a property for third party apps #375
Comments
thestinger
added
the
Type: enhancement
label
Aug 19, 2016
thestinger
added
the
project
label
Dec 3, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
xifumi
commented
Dec 3, 2016
|
Can you elaborate? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
thestinger
Dec 3, 2016
Contributor
The SELinux policy currently allows executing data from app_data_file, i.e. writable app data:
priv_app.te:allow priv_app app_data_file:file rx_file_perms;
untrusted_app.te:allow untrusted_app app_data_file:file { rx_file_perms execmod };
It should be possible to outright remove this for priv_app already, but it needs testing.
For untrusted_app, the domain will need to be split up with only apps opting in to this feature being in the new domain without app_data_file execute access. It can be done for all of the base system apps though. It should already be possible. If there are some exceptions, they can be excluded.
|
The SELinux policy currently allows executing data from app_data_file, i.e. writable app data:
It should be possible to outright remove this for priv_app already, but it needs testing. For untrusted_app, the domain will need to be split up with only apps opting in to this feature being in the new domain without app_data_file execute access. It can be done for all of the base system apps though. It should already be possible. If there are some exceptions, they can be excluded. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
xifumi
Dec 3, 2016
It should be possible to outright remove this for priv_app already, but it needs testing.
That might break priv-apps that engage in Classloading. Lemme dig into this a bit more and see if this can be done upstream.
xifumi
commented
Dec 3, 2016
|
That might break priv-apps that engage in Classloading. Lemme dig into this a bit more and see if this can be done upstream. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
thestinger
Dec 3, 2016
Contributor
There's also #374 about dealing with class loading and perhaps other Java dynamic code execution interfaces. Those probably don't actually require executing data to run code, at least for stuff outside of apps where Android might have optimized it to an oat file.
|
There's also #374 about dealing with class loading and perhaps other Java dynamic code execution interfaces. Those probably don't actually require executing data to run code, at least for stuff outside of apps where Android might have optimized it to an oat file. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
thestinger
Dec 5, 2016
Contributor
@xifumi I submitted an auditallow for the priv_app part of this: https://android-review.googlesource.com/#/c/309851/. I didn't realize that part was present until looking at the policies yesterday. I think that could just go away pretty soon.
The real project here is splitting up untrusted_app and having a system for apps to opt-in, and then ideally as a later step making that the default as a breaking change for a new API level. Once it's split up, all of the untrusted apps in the base system should be able to use the domain without app_data_file execute (which is what I meant by the base system - didn't realize priv_app had this!).
|
@xifumi I submitted an auditallow for the priv_app part of this: https://android-review.googlesource.com/#/c/309851/. I didn't realize that part was present until looking at the policies yesterday. I think that could just go away pretty soon. The real project here is splitting up untrusted_app and having a system for apps to opt-in, and then ideally as a later step making that the default as a breaking change for a new API level. Once it's split up, all of the untrusted apps in the base system should be able to use the domain without app_data_file execute (which is what I meant by the base system - didn't realize priv_app had this!). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
thestinger
Dec 5, 2016
Contributor
(of course to change the default, it would have to be upstream, but CopperheadOS could do the rest downstream)
|
(of course to change the default, it would have to be upstream, but CopperheadOS could do the rest downstream) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
thestinger
Dec 15, 2016
Contributor
It ended up not being possible to do priv_app outright upstream, since Google Play uses it. CopperheadOS has gone ahead and removed it from there, but upstream would need that domain split similar to what CopperheadOS will need for untrusted_app.
|
It ended up not being possible to do priv_app outright upstream, since Google Play uses it. CopperheadOS has gone ahead and removed it from there, but upstream would need that domain split similar to what CopperheadOS will need for untrusted_app. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment|
Replacing this issue with the more specific #530. |
thestinger commentedAug 19, 2016
•
edited
Edited 1 time
-
thestinger
edited Dec 3, 2016
It would be possible to enforce this via SELinux, by splitting up the domains.