/system/netd/server/ |
D | NetworkController.h | 102 unsigned getNetworkForUser(uid_t uid) const; 103 unsigned getNetworkForConnect(uid_t uid) const; 104 void getNetworkContext(unsigned netId, uid_t uid, struct android_net_context* netcontext) const; 116 Permission getPermissionForUser(uid_t uid) const; 118 int checkUserNetworkAccess(uid_t uid, unsigned netId) const; 133 const char* nexthop, bool legacy, uid_t uid, int mtu); 135 const char* nexthop, bool legacy, uid_t uid, int mtu); 137 const char* nexthop, bool legacy, uid_t uid); 145 bool canProtect(uid_t uid) const; 158 uint32_t getNetworkForDnsLocked(unsigned* netId, uid_t uid) const; [all …]
|
D | NetworkController.cpp | 207 uint32_t NetworkController::getNetworkForDnsLocked(unsigned* netId, uid_t uid) const { in getNetworkForDnsLocked() 212 Network* appDefaultNetwork = getPhysicalOrUnreachableNetworkForUserLocked(uid); in getNetworkForDnsLocked() 220 if (*netId == NETID_UNSET && getVirtualNetworkForUserLocked(uid) == nullptr) { in getNetworkForDnsLocked() 227 if (checkUserNetworkAccessLocked(uid, *netId) == 0) { in getNetworkForDnsLocked() 245 VirtualNetwork* virtualNetwork = getVirtualNetworkForUserLocked(uid); in getNetworkForDnsLocked() 261 unsigned NetworkController::getNetworkForUser(uid_t uid) const { in getNetworkForUser() 263 if (VirtualNetwork* virtualNetwork = getVirtualNetworkForUserLocked(uid)) { in getNetworkForUser() 266 if (Network* network = getPhysicalOrUnreachableNetworkForUserLocked(uid)) { in getNetworkForUser() 294 unsigned NetworkController::getNetworkForConnectLocked(uid_t uid) const { in getNetworkForConnectLocked() 295 VirtualNetwork* virtualNetwork = getVirtualNetworkForUserLocked(uid); in getNetworkForConnectLocked() [all …]
|
D | TrafficControllerTest.cpp | 132 int setUpSocketAndTag(int protocol, uint64_t* cookie, uint32_t tag, uid_t uid, in setUpSocketAndTag() argument 138 EXPECT_EQ(0, mTc.tagSocket(sock, tag, uid, callingUid)); in setUpSocketAndTag() 142 void expectUidTag(uint64_t cookie, uid_t uid, uint32_t tag) { in expectUidTag() argument 145 EXPECT_EQ(uid, tagResult.value().uid); in expectUidTag() 151 void populateFakeStats(uint64_t cookie, uint32_t uid, uint32_t tag, StatsKey* key) { in populateFakeStats() argument 152 UidTagValue cookieMapkey = {.uid = (uint32_t)uid, .tag = tag}; in populateFakeStats() 154 *key = {.uid = uid, .tag = tag, .counterSet = TEST_COUNTERSET, .ifaceIndex = 1}; in populateFakeStats() 157 EXPECT_RESULT_OK(mFakeUidCounterSetMap.writeValue(uid, counterSet, BPF_ANY)); in populateFakeStats() 161 EXPECT_RESULT_OK(mFakeAppUidStatsMap.writeValue(uid, statsMapValue, BPF_ANY)); in populateFakeStats() 167 uint32_t uid = TEST_UID; in checkUidOwnerRuleForChain() local [all …]
|
D | TrafficController.cpp | 114 bool TrafficController::hasUpdateDeviceStatsPermission(uid_t uid) { in hasUpdateDeviceStatsPermission() argument 117 uint32_t appId = uid % PER_USER_RANGE; in hasUpdateDeviceStatsPermission() 308 int TrafficController::tagSocket(int sockFd, uint32_t tag, uid_t uid, uid_t callingUid) { in tagSocket() argument 310 if (uid != callingUid && !hasUpdateDeviceStatsPermission(callingUid)) { in tagSocket() 316 UidTagValue newKey = {.uid = (uint32_t)uid, .tag = tag}; in tagSocket() 325 const auto countUidStatsEntries = [uid, &totalEntryCount, &perUidEntryCount]( in tagSocket() 328 if (key.uid == uid) { in tagSocket() 358 totalEntryCount, uid, perUidEntryCount); in tagSocket() 388 int TrafficController::setCounterSet(int counterSetNum, uid_t uid, uid_t callingUid) { in setCounterSet() argument 397 Status res = mUidCounterSetMap.deleteValue(uid); in setCounterSet() [all …]
|
/system/core/libqtaguid/ |
D | qtaguid.c | 80 int legacy_tagSocket(int sockfd, int tag, uid_t uid) { in legacy_tagSocket() argument 87 snprintf(lineBuf, sizeof(lineBuf), "t %d %" PRIu64 " %d", sockfd, kTag, uid); in legacy_tagSocket() 89 ALOGV("Tagging socket %d with tag %" PRIx64 "{%u,0} for uid %d", sockfd, kTag, tag, uid); in legacy_tagSocket() 94 tag, uid, res); in legacy_tagSocket() 115 int legacy_setCounterSet(int counterSetNum, uid_t uid) { in legacy_setCounterSet() argument 119 ALOGV("Setting counters to set %d for uid %d", counterSetNum, uid); in legacy_setCounterSet() 121 snprintf(lineBuf, sizeof(lineBuf), "s %d %d", counterSetNum, uid); in legacy_setCounterSet() 126 int legacy_deleteTagData(int tag, uid_t uid) { in legacy_deleteTagData() argument 131 ALOGV("Deleting tag data with tag %" PRIx64 "{%d,0} for uid %d", kTag, tag, uid); in legacy_deleteTagData() 135 snprintf(lineBuf, sizeof(lineBuf), "d %" PRIu64 " %d", kTag, uid); in legacy_deleteTagData() [all …]
|
/system/core/storaged/tools/ |
D | ranker.py | 124 uid = " ".join(words[:i]) 125 if uid in uids and args.combine: 126 uid_io = uids[uid][0] 129 uids[uid][0] = uid_io 132 uids[uid] = [uid_io] 134 uids[uid].append({}) 135 cur_uid = uid 149 uid_rank = [[(uids[uid][0][i], uid) for uid in uids] for i in range(8)] 164 uid = uid_rank[i][j][1] 165 uid_stat = " ".join([str(uid_io) for uid_io in uids[uid][0]]) [all …]
|
/system/extras/su/ |
D | su.cpp | 29 void pwtoid(const char* tok, uid_t* uid, gid_t* gid) { in pwtoid() argument 32 if (uid) *uid = pw->pw_uid; in pwtoid() 39 if (uid) *uid = tmpid; in pwtoid() 44 void extract_uidgids(const char* uidgids, uid_t* uid, gid_t* gid, gid_t* gids, int* gids_count) { in extract_uidgids() argument 51 *gid = *uid = 0; in extract_uidgids() 60 pwtoid(tok, uid, gid); in extract_uidgids() 101 uid_t uid = 0; in main() local 108 extract_uidgids(*argv, &uid, &gid, gids, &gids_count); in main() 118 if (setuid(uid)) error(1, errno, "setuid failed"); in main() 123 struct passwd* pw = getpwuid(uid); in main()
|
/system/core/libprocessgroup/ |
D | processgroup.cpp | 118 bool SetProcessProfiles(uid_t uid, pid_t pid, const std::vector<std::string>& profiles) { in SetProcessProfiles() argument 119 return TaskProfiles::GetInstance().SetProcessProfiles(uid, pid, profiles); in SetProcessProfiles() 126 static std::string ConvertUidToPath(const char* cgroup, uid_t uid) { in ConvertUidToPath() argument 127 return StringPrintf("%s/uid_%d", cgroup, uid); in ConvertUidToPath() 130 static std::string ConvertUidPidToPath(const char* cgroup, uid_t uid, int pid) { in ConvertUidPidToPath() argument 131 return StringPrintf("%s/uid_%d/pid_%d", cgroup, uid, pid); in ConvertUidPidToPath() 134 static int RemoveProcessGroup(const char* cgroup, uid_t uid, int pid, unsigned int retries) { in RemoveProcessGroup() argument 136 auto uid_pid_path = ConvertUidPidToPath(cgroup, uid, pid); in RemoveProcessGroup() 137 auto uid_path = ConvertUidToPath(cgroup, uid); in RemoveProcessGroup() 153 std::unique_ptr<DIR, decltype(&closedir)> uid(opendir(uid_path.c_str()), closedir); in RemoveUidProcessGroups() local [all …]
|
/system/security/keystore2/legacykeystore/ |
D | lib.rs | 152 fn remove_uid(&mut self, uid: u32) -> Result<()> { in remove_uid() 154 tx.execute("DELETE FROM profiles WHERE owner = ?;", params![uid]) in remove_uid() 288 fn get_effective_uid(uid: i32) -> Result<u32> { in get_effective_uid() 291 let uid = uid as u32; in get_effective_uid() localVariable 293 if uid == UID_SELF as u32 || uid == calling_uid { in get_effective_uid() 295 } else if calling_uid == AID_SYSTEM && uid == Self::AID_WIFI { in get_effective_uid() 303 format!("In get_effective_uid: caller: {}, requested uid: {}.", calling_uid, uid) in get_effective_uid() 308 fn get(&self, alias: &str, uid: i32) -> Result<Vec<u8>> { in get() 310 let uid = Self::get_effective_uid(uid).context("In get.")?; in get() localVariable 312 if let Some(entry) = db.get(uid, alias).context("In get: Trying to load entry from DB.")? { in get() [all …]
|
/system/core/libcutils/ |
D | qtaguid.cpp | 94 int qtaguid_tagSocket(int sockfd, int tag, uid_t uid) { in qtaguid_tagSocket() argument 103 ALOGV("Tagging socket %d with tag %u for uid %d", sockfd, tag, uid); in qtaguid_tagSocket() 104 return getHandler().netdTagSocket(sockfd, tag, uid); in qtaguid_tagSocket() 118 int qtaguid_setCounterSet(int counterSetNum, uid_t uid) { in qtaguid_setCounterSet() argument 119 ALOGV("Setting counters to set %d for uid %d", counterSetNum, uid); in qtaguid_setCounterSet() 120 return getHandler().netdSetCounterSet(counterSetNum, uid); in qtaguid_setCounterSet() 123 int qtaguid_deleteTagData(int tag, uid_t uid) { in qtaguid_deleteTagData() argument 124 ALOGV("Deleting tag data with tag %u for uid %d", tag, uid); in qtaguid_deleteTagData() 125 return getHandler().netdDeleteTagData(tag, uid); in qtaguid_deleteTagData()
|
D | multiuser.cpp | 20 userid_t multiuser_get_user_id(uid_t uid) { in multiuser_get_user_id() argument 21 return uid / AID_USER_OFFSET; in multiuser_get_user_id() 24 appid_t multiuser_get_app_id(uid_t uid) { in multiuser_get_app_id() argument 25 return uid % AID_USER_OFFSET; in multiuser_get_app_id() 66 gid_t multiuser_get_shared_app_gid(uid_t uid) { in multiuser_get_shared_app_gid() argument 67 return multiuser_get_shared_gid(multiuser_get_user_id(uid), multiuser_get_app_id(uid)); in multiuser_get_shared_app_gid()
|
D | uevent.cpp | 36 uid_t uid = -1; in uevent_kernel_multicast_recv() local 37 return uevent_kernel_multicast_uid_recv(socket, buffer, length, &uid); in uevent_kernel_multicast_recv() 49 ssize_t uevent_kernel_multicast_uid_recv(int socket, void* buffer, size_t length, uid_t* uid) { in uevent_kernel_multicast_uid_recv() argument 50 return uevent_kernel_recv(socket, buffer, length, true, uid); in uevent_kernel_multicast_uid_recv() 53 ssize_t uevent_kernel_recv(int socket, void* buffer, size_t length, bool require_group, uid_t* uid)… in uevent_kernel_recv() argument 62 *uid = -1; in uevent_kernel_recv() 75 *uid = cred->uid; in uevent_kernel_recv()
|
/system/core/libprocessgroup/include/processgroup/ |
D | processgroup.h | 33 bool SetProcessProfiles(uid_t uid, pid_t pid, const std::vector<std::string>& profiles); 52 int killProcessGroup(uid_t uid, int initialPid, int signal, int* max_processes = nullptr); 56 int killProcessGroupOnce(uid_t uid, int initialPid, int signal, int* max_processes = nullptr); 58 int createProcessGroup(uid_t uid, int initialPid, bool memControl = false); 62 bool setProcessGroupSwappiness(uid_t uid, int initialPid, int swappiness); 63 bool setProcessGroupSoftLimit(uid_t uid, int initialPid, int64_t softLimitInBytes); 64 bool setProcessGroupLimit(uid_t uid, int initialPid, int64_t limitInBytes);
|
/system/vold/ |
D | AppFuseUtil.cpp | 36 static android::status_t GetMountPath(uid_t uid, const std::string& name, std::string* path) { in GetMountPath() argument 47 *path = StringPrintf("/mnt/appfuse/%d_%s", uid, name.c_str()); in GetMountPath() 73 static android::status_t RunCommand(const std::string& command, uid_t uid, const std::string& path, in RunCommand() argument 77 << uid; in RunCommand() 105 int MountAppFuse(uid_t uid, int mountId, android::base::unique_fd* device_fd) { in MountAppFuse() argument 110 if (GetMountPath(uid, name, &path) != android::OK) { in MountAppFuse() 136 return RunCommand("mount", uid, path, device_fd->get()); in MountAppFuse() 139 int UnmountAppFuse(uid_t uid, int mountId) { in UnmountAppFuse() argument 144 if (GetMountPath(uid, name, &path) != android::OK) { in UnmountAppFuse() 149 return RunCommand("unmount", uid, path, -1 /* device_fd */); in UnmountAppFuse() [all …]
|
/system/core/storaged/ |
D | storaged_utils.cpp | 73 for (const auto& uid : uids) { in log_console_running_uids_info() local 76 uid.name.c_str(), in log_console_running_uids_info() 77 uid.io[0].rchar, uid.io[0].wchar, uid.io[0].read_bytes, uid.io[0].write_bytes, in log_console_running_uids_info() 78 uid.io[1].rchar, uid.io[1].wchar, uid.io[1].read_bytes, uid.io[1].write_bytes, in log_console_running_uids_info() 79 uid.io[0].fsync, uid.io[1].fsync); in log_console_running_uids_info() 81 for (const auto& task_it : uid.tasks) { in log_console_running_uids_info()
|
D | storaged_uid_monitor.cpp | 63 !ParseUint(fields[0], &uid) || in parse_uid_io_stats() 175 uid_io_stats[u.uid] = u; in get_uid_io_stats_locked() 176 uid_io_stats[u.uid].name = std::to_string(u.uid); in get_uid_io_stats_locked() 177 uids.push_back(u.uid); in get_uid_io_stats_locked() 178 uid_names.push_back(&uid_io_stats[u.uid].name); in get_uid_io_stats_locked() 179 if (last_uid_io_stats_.find(u.uid) == last_uid_io_stats_.end()) { in get_uid_io_stats_locked() 182 uid_io_stats[u.uid].name = last_uid_io_stats_[u.uid].name; in get_uid_io_stats_locked() 188 uid_io_stats[u.uid].tasks[t.pid] = t; in get_uid_io_stats_locked() 312 const uid_info& uid = it.second; in update_curr_io_stats_locked() local 313 if (curr_io_stats_.find(uid.name) == curr_io_stats_.end()) { in update_curr_io_stats_locked() [all …]
|
/system/logging/logd/ |
D | LogTags.h | 67 uint32_t nameToTag(uid_t uid, const char* name, const char* format); 81 static std::string formatEntry(uint32_t tag, uid_t uid, const char* name, 84 std::string formatEntry_locked(uint32_t tag, uid_t uid, 89 void AddEventLogTags(uint32_t tag, uid_t uid, const std::string& Name, 93 void WriteDynamicEventLogTags(uint32_t tag, uid_t uid); 94 void WriteDebugEventLogTags(uint32_t tag, uid_t uid); 96 void WritePersistEventLogTags(uint32_t tag, uid_t uid = AID_ROOT, 109 void WritePmsgEventLogTags(uint32_t tag, uid_t uid = AID_ROOT); 115 std::string formatEntry(uint32_t tag, uid_t uid); 120 std::string formatGetEventTag(uid_t uid, const char* name,
|
D | LogTags.cpp | 137 void LogTags::AddEventLogTags(uint32_t tag, uid_t uid, const std::string& Name, in AddEventLogTags() argument 167 if (uid == AID_ROOT) { in AddEventLogTags() 170 } else if (ut->second.find(uid) == ut->second.end()) { in AddEventLogTags() 171 const_cast<uid_list&>(ut->second).emplace(uid); in AddEventLogTags() 174 } else if (newOne && (uid != AID_ROOT)) { in AddEventLogTags() 175 tag2uid[tag].emplace(uid); in AddEventLogTags() 185 WritePersistEventLogTags(tag, uid, source); in AddEventLogTags() 249 uid_t uid = AID_ROOT; in ReadFileEventLogTags() local 252 uid = sniffUid(cp, endp); in ReadFileEventLogTags() 264 AddEventLogTags((uint32_t)Tag, uid, Name, Format, in ReadFileEventLogTags() [all …]
|
D | SerializedLogEntry.h | 36 SerializedLogEntry(uid_t uid, pid_t pid, pid_t tid, uint64_t sequence, log_time realtime, in SerializedLogEntry() argument 38 : uid_(uid), in SerializedLogEntry() 53 .uid = uid(), in ToLogStatisticsElement() 73 entry.uid = uid(); in Flush() 81 uid_t uid() const { return uid_; } in uid() function
|
/system/core/run-as/ |
D | run-as.cpp | 73 static void check_directory(const char* path, uid_t uid) { in check_directory() argument 88 if (st.st_uid != uid || st.st_gid != uid) { in check_directory() 89 error(1, 0, "%s has wrong owner: %d/%d, not %d", path, st.st_uid, st.st_gid, uid); in check_directory() 102 static void check_data_path(const char* package_name, const char* data_path, uid_t uid) { in check_data_path() argument 142 check_directory(data_path, uid); in check_data_path() 211 if (info.uid == 0) { in main() 217 if ((UID_MAX - info.uid) / AID_USER_OFFSET < (uid_t)userId) { in main() 222 uid_t userAppId = (AID_USER_OFFSET * userId) + info.uid; in main() 239 uid_t uid = userAppId; in main() local 243 minijail_change_uid(j.get(), uid); in main() [all …]
|
/system/bt/profile/avrcp/ |
D | media_id_map.h | 34 std::string get_media_id(uint64_t uid) { in get_media_id() argument 35 const auto& uid_it = uid_to_media_id_.find(uid); in get_media_id() 51 uint64_t uid = media_id_to_uid_.size() + 1; in insert() local 52 media_id_to_uid_.insert(std::pair<std::string, uint64_t>(media_id, uid)); in insert() 53 uid_to_media_id_.insert(std::pair<uint64_t, std::string>(uid, media_id)); in insert() 54 return uid; in insert()
|
/system/core/init/ |
D | lmkd_service.cpp | 37 static LmkdRegistrationResult RegisterProcess(uid_t uid, pid_t pid, int oom_score_adjust) { in RegisterProcess() argument 49 params.uid = uid; in RegisterProcess() 89 if (RegisterProcess(svc->uid(), svc->pid(), svc->oom_score_adjust()) != in RegisterServices() 98 void LmkdRegister(const std::string& name, uid_t uid, pid_t pid, int oom_score_adjust) { in LmkdRegister() argument 102 result = RegisterProcess(uid, pid, oom_score_adjust); in LmkdRegister() 105 result = RegisterProcess(uid, pid, oom_score_adjust); in LmkdRegister()
|
/system/security/keystore2/aidl/android/security/legacykeystore/ |
D | ILegacyKeystore.aidl | 65 byte[] get(in String alias, int uid); in get() argument 79 void put(in String alias, int uid, in byte[] blob); in put() argument 88 void remove(in String alias, int uid); in remove() argument 97 String[] list(in String prefix, int uid); in list() argument
|
/system/netd/include/ |
D | NetdClient.h | 39 int setNetworkForUser(uid_t uid, int socketFd); 41 int queryUserAccess(uid_t uid, unsigned netId); 45 int tagSocket(int socketFd, uint32_t tag, uid_t uid); 49 int setCounterSet(uint32_t counterSet, uid_t uid); 51 int deleteTagData(uint32_t tag, uid_t uid);
|
/system/core/sdcard/ |
D | sdcard.cpp | 92 static void drop_privs(uid_t uid, gid_t gid) { in drop_privs() argument 96 minijail_change_uid(j.get(), uid); in drop_privs() 166 static void run_sdcardfs(const std::string& source_path, const std::string& label, uid_t uid, in run_sdcardfs() argument 178 if (!sdcardfs_setup(source_path, dest_path_default, uid, gid, multi_user, userid, in run_sdcardfs() 181 !sdcardfs_setup_secondary(dest_path_default, source_path, dest_path_read, uid, gid, in run_sdcardfs() 184 !sdcardfs_setup_secondary(dest_path_default, source_path, dest_path_write, uid, gid, in run_sdcardfs() 187 !sdcardfs_setup_secondary(dest_path_default, source_path, dest_path_full, uid, gid, in run_sdcardfs() 196 if (!sdcardfs_setup(source_path, dest_path_default, uid, gid, multi_user, userid, in run_sdcardfs() 199 !sdcardfs_setup_secondary(dest_path_default, source_path, dest_path_read, uid, gid, in run_sdcardfs() 202 !sdcardfs_setup_secondary(dest_path_default, source_path, dest_path_write, uid, gid, in run_sdcardfs() [all …]
|