/system/security/keystore/ |
D | permissions.cpp | 53 uid_t uid; member 70 uid_t uid; member 94 uid_t uid; member 116 snprintf(buf, len, "pid=%d uid=%d sid=%s", ad->pid, ad->uid, sid); in audit_callback() 136 static bool keystore_selinux_check_access(uid_t uid, perm_t perm, pid_t spid, const char* ssid) { in keystore_selinux_check_access() argument 154 ad.uid = uid; in keystore_selinux_check_access() 168 uid_t get_keystore_euid(uid_t uid) { in get_keystore_euid() argument 171 if (user.uid == uid) { in get_keystore_euid() 176 return uid; in get_keystore_euid() 179 bool has_permission(uid_t uid, perm_t perm, pid_t spid, const char* sid) { in has_permission() argument [all …]
|
/system/netd/server/ |
D | NetworkController.h | 101 uint32_t getNetworkForDns(unsigned* netId, uid_t uid) const; 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; 131 const char* nexthop, bool legacy, uid_t uid) WARN_UNUSED_RESULT; 133 const char* nexthop, bool legacy, uid_t uid) WARN_UNUSED_RESULT; 141 bool canProtect(uid_t uid) const; 150 uint32_t getNetworkForDnsLocked(unsigned* netId, uid_t uid) const; [all …]
|
D | NetworkController.cpp | 190 uint32_t NetworkController::getNetworkForDnsLocked(unsigned* netId, uid_t uid) const { in getNetworkForDnsLocked() 200 if (*netId == NETID_UNSET && getVirtualNetworkForUserLocked(uid) == nullptr) { in getNetworkForDnsLocked() 207 if (checkUserNetworkAccessLocked(uid, *netId) == 0) { in getNetworkForDnsLocked() 226 VirtualNetwork* virtualNetwork = getVirtualNetworkForUserLocked(uid); in getNetworkForDnsLocked() 239 uint32_t NetworkController::getNetworkForDns(unsigned* netId, uid_t uid) const { in getNetworkForDns() 241 return getNetworkForDnsLocked(netId, uid); in getNetworkForDns() 246 unsigned NetworkController::getNetworkForUser(uid_t uid) const { in getNetworkForUser() 248 if (VirtualNetwork* virtualNetwork = getVirtualNetworkForUserLocked(uid)) { in getNetworkForUser() 268 unsigned NetworkController::getNetworkForConnectLocked(uid_t uid) const { in getNetworkForConnectLocked() 269 VirtualNetwork* virtualNetwork = getVirtualNetworkForUserLocked(uid); in getNetworkForConnectLocked() [all …]
|
D | TrafficControllerTest.cpp | 133 int setUpSocketAndTag(int protocol, uint64_t* cookie, uint32_t tag, uid_t uid, in setUpSocketAndTag() argument 139 EXPECT_EQ(0, mTc.tagSocket(sock, tag, uid, callingUid)); in setUpSocketAndTag() 143 void expectUidTag(uint64_t cookie, uid_t uid, uint32_t tag) { in expectUidTag() argument 146 EXPECT_EQ(uid, tagResult.value().uid); in expectUidTag() 152 void populateFakeStats(uint64_t cookie, uint32_t uid, uint32_t tag, StatsKey* key) { in populateFakeStats() argument 153 UidTag cookieMapkey = {.uid = (uint32_t)uid, .tag = tag}; in populateFakeStats() 155 *key = {.uid = uid, .tag = tag, .counterSet = TEST_COUNTERSET, .ifaceIndex = 1}; in populateFakeStats() 158 EXPECT_TRUE(isOk(mFakeUidCounterSetMap.writeValue(uid, counterSet, BPF_ANY))); in populateFakeStats() 162 EXPECT_TRUE(isOk(mFakeAppUidStatsMap.writeValue(uid, statsMapValue, BPF_ANY))); in populateFakeStats() 168 uint32_t uid = TEST_UID; in checkUidOwnerRuleForChain() local [all …]
|
D | TrafficController.cpp | 111 bool TrafficController::hasUpdateDeviceStatsPermission(uid_t uid) { in hasUpdateDeviceStatsPermission() argument 114 uint32_t appId = uid % PER_USER_RANGE; in hasUpdateDeviceStatsPermission() 348 int TrafficController::tagSocket(int sockFd, uint32_t tag, uid_t uid, uid_t callingUid) { in tagSocket() argument 350 if (uid != callingUid && !hasUpdateDeviceStatsPermission(callingUid)) { in tagSocket() 355 if (legacy_tagSocket(sockFd, tag, uid)) return -errno; in tagSocket() 361 UidTag newKey = {.uid = (uint32_t)uid, .tag = tag}; in tagSocket() 370 const auto countUidStatsEntries = [uid, &totalEntryCount, &perUidEntryCount]( in tagSocket() 372 if (key.uid == uid) { in tagSocket() 402 totalEntryCount, uid, perUidEntryCount); in tagSocket() 434 int TrafficController::setCounterSet(int counterSetNum, uid_t uid, uid_t callingUid) { in setCounterSet() argument [all …]
|
/system/core/libprocessgroup/ |
D | processgroup.cpp | 114 bool SetProcessProfiles(uid_t uid, pid_t pid, const std::vector<std::string>& profiles, in SetProcessProfiles() argument 124 if (!profile->ExecuteForProcess(uid, pid)) { in SetProcessProfiles() 155 static std::string ConvertUidToPath(const char* cgroup, uid_t uid) { in ConvertUidToPath() argument 156 return StringPrintf("%s/uid_%d", cgroup, uid); in ConvertUidToPath() 159 static std::string ConvertUidPidToPath(const char* cgroup, uid_t uid, int pid) { in ConvertUidPidToPath() argument 160 return StringPrintf("%s/uid_%d/pid_%d", cgroup, uid, pid); in ConvertUidPidToPath() 163 static int RemoveProcessGroup(const char* cgroup, uid_t uid, int pid) { in RemoveProcessGroup() argument 166 auto uid_pid_path = ConvertUidPidToPath(cgroup, uid, pid); in RemoveProcessGroup() 169 auto uid_path = ConvertUidToPath(cgroup, uid); in RemoveProcessGroup() 176 std::unique_ptr<DIR, decltype(&closedir)> uid(opendir(uid_path.c_str()), closedir); in RemoveUidProcessGroups() local [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/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/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/gatekeeperd/ |
D | gatekeeperd.cpp | 76 void store_sid(uint32_t uid, uint64_t sid) { in store_sid() argument 78 snprintf(filename, sizeof(filename), "%u", uid); in store_sid() 117 void maybe_store_sid(uint32_t uid, uint64_t sid) { in maybe_store_sid() argument 119 snprintf(filename, sizeof(filename), "%u", uid); in maybe_store_sid() 121 store_sid(uid, sid); in maybe_store_sid() 125 uint64_t read_sid(uint32_t uid) { in read_sid() argument 128 snprintf(filename, sizeof(filename), "%u", uid); in read_sid() 136 void clear_sid(uint32_t uid) { in clear_sid() argument 138 snprintf(filename, sizeof(filename), "%u", uid); in clear_sid() 141 store_sid(uid, 0); in clear_sid() [all …]
|
/system/core/libprocessgroup/include/processgroup/ |
D | processgroup.h | 33 bool SetProcessProfiles(uid_t uid, pid_t pid, const std::vector<std::string>& profiles, 45 int killProcessGroup(uid_t uid, int initialPid, int signal); 49 int killProcessGroupOnce(uid_t uid, int initialPid, int signal); 51 int createProcessGroup(uid_t uid, int initialPid, bool memControl = false); 55 bool setProcessGroupSwappiness(uid_t uid, int initialPid, int swappiness); 56 bool setProcessGroupSoftLimit(uid_t uid, int initialPid, int64_t softLimitInBytes); 57 bool setProcessGroupLimit(uid_t uid, int initialPid, int64_t limitInBytes);
|
/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/logd/ |
D | LogListener.cpp | 85 cred->uid = DEFAULT_OVERFLOWUID; in onDataAvailable() 88 if (cred->uid == AID_LOGD) { in onDataAvailable() 105 !clientHasLogCredentials(cred->uid, cred->gid, cred->pid))) { in onDataAvailable() 120 if (cred->uid == DEFAULT_OVERFLOWUID) { in onDataAvailable() 121 uid_t uid = in onDataAvailable() local 123 if (uid == AID_LOGD) { in onDataAvailable() 124 uid = logbuf ? logbuf->pidToUid(header->tid) in onDataAvailable() 127 if (uid != AID_LOGD) cred->uid = uid; in onDataAvailable() 138 logId, header->realtime, cred->uid, cred->pid, header->tid, msg, in onDataAvailable()
|
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 | 132 void LogTags::AddEventLogTags(uint32_t tag, uid_t uid, const std::string& Name, in AddEventLogTags() argument 162 if (uid == AID_ROOT) { in AddEventLogTags() 165 } else if (ut->second.find(uid) == ut->second.end()) { in AddEventLogTags() 166 const_cast<uid_list&>(ut->second).emplace(uid); in AddEventLogTags() 169 } else if (newOne && (uid != AID_ROOT)) { in AddEventLogTags() 170 tag2uid[tag].emplace(uid); in AddEventLogTags() 180 WritePersistEventLogTags(tag, uid, source); in AddEventLogTags() 247 uid_t uid = AID_ROOT; in ReadFileEventLogTags() local 250 uid = sniffUid(cp, endp); in ReadFileEventLogTags() 262 AddEventLogTags((uint32_t)Tag, uid, Name, Format, in ReadFileEventLogTags() [all …]
|
D | LogCommand.cpp | 60 bool clientHasLogCredentials(uid_t uid, gid_t gid, pid_t pid) { in clientHasLogCredentials() argument 61 if ((uid == AID_ROOT) || (uid == AID_SYSTEM) || (uid == AID_LOG)) { in clientHasLogCredentials() 119 if ((uid == u[0]) && (uid == u[1]) && (uid == u[2]) && in clientHasLogCredentials() 120 (uid == u[3])) { in clientHasLogCredentials()
|
/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() 178 uid_io_stats[u.uid] = u; in get_uid_io_stats_locked() 179 uid_io_stats[u.uid].name = std::to_string(u.uid); in get_uid_io_stats_locked() 180 uids.push_back(u.uid); in get_uid_io_stats_locked() 181 uid_names.push_back(&uid_io_stats[u.uid].name); in get_uid_io_stats_locked() 182 if (last_uid_io_stats_.find(u.uid) == last_uid_io_stats_.end()) { in get_uid_io_stats_locked() 185 uid_io_stats[u.uid].name = last_uid_io_stats_[u.uid].name; in get_uid_io_stats_locked() 191 uid_io_stats[u.uid].tasks[t.pid] = t; in get_uid_io_stats_locked() 315 const uid_info& uid = it.second; in update_curr_io_stats_locked() local 316 if (curr_io_stats_.find(uid.name) == curr_io_stats_.end()) { in update_curr_io_stats_locked() [all …]
|
/system/netd/bpf_progs/ |
D | netd.h | 35 uint32_t uid; member 40 uint32_t uid; member 87 static __always_inline int is_system_uid(uint32_t uid) { in DEFINE_BPF_MAP() 88 return (uid <= MAX_SYSTEM_UID) && (uid >= MIN_SYSTEM_UID); in DEFINE_BPF_MAP() 166 static inline int bpf_owner_match(struct __sk_buff* skb, uint32_t uid, int direction) { in bpf_owner_match() argument 169 if ((uid <= MAX_SYSTEM_UID) && (uid >= MIN_SYSTEM_UID)) return BPF_PASS; in bpf_owner_match() 173 UidOwnerValue* uidEntry = bpf_uid_owner_map_lookup_elem(&uid); in bpf_owner_match() 217 uint32_t uid, tag; in bpf_traffic_account() local 219 uid = utag->uid; in bpf_traffic_account() 222 uid = sock_uid; in bpf_traffic_account() [all …]
|
/system/security/keystore/binder/android/security/keystore/ |
D | IKeystoreService.aidl | 33 byte[] get(String name, int uid); in get() argument 34 int insert(String name, in byte[] item, int uid, int flags); in insert() argument 35 int del(String name, int uid); in del() argument 36 int exist(String name, int uid); in exist() argument 37 String[] list(String namePrefix, int uid); in list() argument 45 long getmtime(String name, int uid); in getmtime() argument 47 int clear_uid(long uid); in clear_uid() argument 50 …racteristicsCallback cb, String alias, in KeymasterArguments arguments, in byte[] entropy, int uid, in generateKey() argument 53 int uid); in getKeyCharacteristics() argument 55 in byte[] keyData, int uid, int flags); in importKey() argument [all …]
|
/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()
|