summaryrefslogtreecommitdiff
path: root/server/NetworkController.cpp
diff options
context:
space:
mode:
authorLuke Huang <huangluke@google.com>2020-06-16 19:14:05 +0800
committerLuke Huang <huangluke@google.com>2020-06-18 04:38:44 +0800
commit86983208a199d147d63033aec7794666e55d27a8 (patch)
treeac16144b2380c0b91aa7e1e63ca599e7315822cd /server/NetworkController.cpp
parenta60b74e9f13c2f5cf618797bb3e11d56d5734591 (diff)
Provide a way to disable socket() and DNS lookups in libnetd_client.
This is a Client-only solution. - Add to NetdClient a per-process std::atomic_boolean similar to netIdForProcess and netIdForResolv. - The boolean says whether the process should be allowed Internet connectivity. - Add an @hide method to NetUtils.java to set the boolean; call it from the initialization code of the new process just after forking from zygote. - Make netdClientSocket and dnsOpenProxy check the boolean. If the boolean is false, return EPERM from socket calls. Bug: 150028556 Test: atest netd_integration_test Test: atest CtsAppSecurityHostTestCases:UseProcessTest Change-Id: Ic697afd284ba250e56bd9492241452762da15770
Diffstat (limited to 'server/NetworkController.cpp')
0 files changed, 0 insertions, 0 deletions