/system/security/keystore/ |
D | permissions.cpp | 53 uid_t uid; member 68 uid_t uid; member 92 uid_t uid; member 114 snprintf(buf, len, "pid=%d uid=%d sid=%s", ad->pid, ad->uid, sid); in audit_callback() 134 static bool keystore_selinux_check_access(uid_t uid, perm_t perm, pid_t spid, const char* ssid) { in keystore_selinux_check_access() argument 152 ad.uid = uid; in keystore_selinux_check_access() 166 uid_t get_keystore_euid(uid_t uid) { in get_keystore_euid() argument 169 if (user.uid == uid) { in get_keystore_euid() 174 return uid; in get_keystore_euid() 177 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 | 99 unsigned getNetworkForUser(uid_t uid) const; 100 unsigned getNetworkForConnect(uid_t uid) const; 101 void getNetworkContext(unsigned netId, uid_t uid, struct android_net_context* netcontext) const; 113 Permission getPermissionForUser(uid_t uid) const; 115 int checkUserNetworkAccess(uid_t uid, unsigned netId) const; 128 const char* nexthop, bool legacy, uid_t uid, int mtu); 130 const char* nexthop, bool legacy, uid_t uid, int mtu); 132 const char* nexthop, bool legacy, uid_t uid); 140 bool canProtect(uid_t uid) const; 153 uint32_t getNetworkForDnsLocked(unsigned* netId, uid_t uid) const; [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 | NetworkController.cpp | 205 uint32_t NetworkController::getNetworkForDnsLocked(unsigned* netId, uid_t uid) const { in getNetworkForDnsLocked() 215 if (*netId == NETID_UNSET && getVirtualNetworkForUserLocked(uid) == nullptr) { in getNetworkForDnsLocked() 222 if (checkUserNetworkAccessLocked(uid, *netId) == 0) { in getNetworkForDnsLocked() 240 VirtualNetwork* virtualNetwork = getVirtualNetworkForUserLocked(uid); in getNetworkForDnsLocked() 255 unsigned NetworkController::getNetworkForUser(uid_t uid) const { in getNetworkForUser() 257 if (VirtualNetwork* virtualNetwork = getVirtualNetworkForUserLocked(uid)) { in getNetworkForUser() 277 unsigned NetworkController::getNetworkForConnectLocked(uid_t uid) const { in getNetworkForConnectLocked() 278 VirtualNetwork* virtualNetwork = getVirtualNetworkForUserLocked(uid); in getNetworkForConnectLocked() 285 unsigned NetworkController::getNetworkForConnect(uid_t uid) const { in getNetworkForConnect() 287 return getNetworkForConnectLocked(uid); in getNetworkForConnect() [all …]
|
D | TrafficController.cpp | 110 bool TrafficController::hasUpdateDeviceStatsPermission(uid_t uid) { in hasUpdateDeviceStatsPermission() argument 113 uint32_t appId = uid % PER_USER_RANGE; in hasUpdateDeviceStatsPermission() 311 int TrafficController::tagSocket(int sockFd, uint32_t tag, uid_t uid, uid_t callingUid) { in tagSocket() argument 313 if (uid != callingUid && !hasUpdateDeviceStatsPermission(callingUid)) { in tagSocket() 318 if (legacy_tagSocket(sockFd, tag, uid)) return -errno; in tagSocket() 324 UidTagValue newKey = {.uid = (uint32_t)uid, .tag = tag}; in tagSocket() 333 const auto countUidStatsEntries = [uid, &totalEntryCount, &perUidEntryCount]( in tagSocket() 336 if (key.uid == uid) { in tagSocket() 366 totalEntryCount, uid, perUidEntryCount); in tagSocket() 400 int TrafficController::setCounterSet(int counterSetNum, uid_t uid, uid_t callingUid) { in setCounterSet() argument [all …]
|
/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) { in RemoveProcessGroup() argument 137 auto uid_pid_path = ConvertUidPidToPath(cgroup, uid, pid); in RemoveProcessGroup() 140 auto uid_path = ConvertUidToPath(cgroup, uid); in RemoveProcessGroup() 147 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/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/gatekeeperd/ |
D | gatekeeperd.cpp | 79 void store_sid(uint32_t uid, uint64_t sid) { in store_sid() argument 81 snprintf(filename, sizeof(filename), "%u", uid); in store_sid() 120 void maybe_store_sid(uint32_t uid, uint64_t sid) { in maybe_store_sid() argument 122 snprintf(filename, sizeof(filename), "%u", uid); in maybe_store_sid() 124 store_sid(uid, sid); in maybe_store_sid() 128 uint64_t read_sid(uint32_t uid) { in read_sid() argument 131 snprintf(filename, sizeof(filename), "%u", uid); in read_sid() 139 void clear_sid(uint32_t uid) { in clear_sid() argument 141 snprintf(filename, sizeof(filename), "%u", uid); in clear_sid() 144 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); 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/core/gatekeeperd/binder/android/service/gatekeeper/ |
D | IGateKeeperService.aidl | 41 GateKeeperResponse enroll(int uid, in @nullable byte[] currentPasswordHandle, in enroll() argument 52 … GateKeeperResponse verify(int uid, in byte[] enrolledPasswordHandle, in byte[] providedPassword); in verify() argument 65 GateKeeperResponse verifyChallenge(int uid, long challenge, in byte[] enrolledPasswordHandle, in verifyChallenge() argument 73 long getSecureUserId(int uid); in getSecureUserId() argument 80 void clearSecureUserId(int uid); in clearSecureUserId() argument
|
/system/core/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 | 136 void LogTags::AddEventLogTags(uint32_t tag, uid_t uid, const std::string& Name, in AddEventLogTags() argument 166 if (uid == AID_ROOT) { in AddEventLogTags() 169 } else if (ut->second.find(uid) == ut->second.end()) { in AddEventLogTags() 170 const_cast<uid_list&>(ut->second).emplace(uid); in AddEventLogTags() 173 } else if (newOne && (uid != AID_ROOT)) { in AddEventLogTags() 174 tag2uid[tag].emplace(uid); in AddEventLogTags() 184 WritePersistEventLogTags(tag, uid, source); in AddEventLogTags() 248 uid_t uid = AID_ROOT; in ReadFileEventLogTags() local 251 uid = sniffUid(cp, endp); in ReadFileEventLogTags() 263 AddEventLogTags((uint32_t)Tag, uid, Name, Format, in ReadFileEventLogTags() [all …]
|
D | LogPermissions.cpp | 56 bool clientHasLogCredentials(uid_t uid, gid_t gid, pid_t pid) { in clientHasLogCredentials() argument 57 if ((uid == AID_ROOT) || (uid == AID_SYSTEM) || (uid == AID_LOG)) { in clientHasLogCredentials() 115 if ((uid == u[0]) && (uid == u[1]) && (uid == u[2]) && in clientHasLogCredentials() 116 (uid == u[3])) { in clientHasLogCredentials()
|
/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/security/keystore/binder/android/security/keystore/ |
D | IKeystoreService.aidl | 36 byte[] get(String name, int uid); in get() argument 38 int insert(String name, in byte[] item, int uid, int flags); in insert() argument 40 int del(String name, int uid); in del() argument 42 int exist(String name, int uid); in exist() argument 44 String[] list(String namePrefix, int uid); in list() argument 52 long getmtime(String name, int uid); in getmtime() argument 56 int clear_uid(long uid); in clear_uid() argument 59 …racteristicsCallback cb, String alias, in KeymasterArguments arguments, in byte[] entropy, int uid, in generateKey() argument 62 int uid); in getKeyCharacteristics() argument 64 in byte[] keyData, int uid, int flags); in importKey() argument [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()
|