Description: shm pid入参 漏洞修复

IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/IAWM6R
Feature Or Bugfix: Bugfix
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
This commit is contained in:
hw_llm 2024-10-12 17:53:01 +08:00
parent 31da79ec80
commit 14c79fc921
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