!1240 【Pick 4.1 Release】shm pid 入参漏洞修复

Merge pull request !1240 from hw_llm/cherry-pick-1728735200
This commit is contained in:
openharmony_ci 2024-10-12 12:49:43 +00:00 committed by Gitee
commit 4b34b96700
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 3 additions and 0 deletions

View File

@ -689,6 +689,9 @@ INT32 ShmCtl(INT32 shmid, INT32 cmd, struct shmid_ds *buf)
(shm_perm.mode & ACCESSPERMS);
seg->ds.shm_ctime = time(NULL);
#ifdef LOSCFG_SHELL
if (OsProcessIDUserCheckInvalid(shm_perm.uid)) {
break;
}
(VOID)memcpy_s(seg->ownerName, OS_PCB_NAME_LEN, OS_PCB_FROM_PID(shm_perm.uid)->processName,
OS_PCB_NAME_LEN);
#endif