diff options
author | Victor Chang <vichang@google.com> | 2017-10-18 13:05:03 +0100 |
---|---|---|
committer | Victor Chang <vichang@google.com> | 2017-10-24 15:29:37 +0100 |
commit | 00494db3844238de691d75ca6fcdc794380871e5 (patch) | |
tree | 3622f7470726f865af0bf838a0e106d55eec178b /annotations/generate_annotated_java_files.py | |
parent | 8f133afd09028a9541b7c05e21886756c0391c7e (diff) |
Don't untag socket before preClose / close
Previously, xt_qtaguid never freed tags when the socket was closed, so
if we didn't untag sockets in userspace it would leak memory. See for
example b/5274621. That was fixed by the fix in b/36374484, so this
code is no longer necessary.
Behavior change
- Automatically untagging sockets on close() is incorrect, because
close() does not close the socket, only the filedescriptor, which might
be only one of the references to the socket. Thus, socket(); dup();
close results in the socket being untagged, even if the dupd socket is
still open.
- Additionally, untagging sockets automatically has undesirable
side-effects. For example, it makes it very difficult for a process to
create and tag a socket, and pass that socket to an app, without losing
the tag.
Workaround to keep old behavior
If an app needs to keep old behavior, the app should call
TrafficStats.untagSocket to remove the tag before sending it to another
process.
Bug: 67425668
Test: CtsLibcoreTestCases
Test: CtsAppSecurityHostTestCases -t android.appsecurity.cts.AppSecurityTests
Test: CtsIncidentHostTestCases -t
com.android.server.cts.NetstatsIncidentTest
Test: CtsOsTestCases -t android.os.cts.StrictModeTest
Test: CtsUsageStatsTestCases -t android.app.usage.cts.NetworkUsageStatsTest
Change-Id: Ic311e626a57dec5584c97c8899468a3c800e7ef0
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions