Description: shm pid入参 漏洞修复

IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/IAWOD7
Feature Or Bugfix: Bugfix
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
(cherry picked commit from <gitee.com//openharmony/kernel_liteos_a/commit/14c79fc921db176c8c7ae87a917fa50217e664ac>
This commit is contained in:
hw_llm 2024-10-12 17:53:01 +08:00
parent f9ccc6e5fd
commit 066a984a97
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