修复ppoll接口"[ERR]OsMemFree check error!"报错

【背景】
1.内核中释放用户空间指针报错:"[ERR]OsMemFree check error!"
2.现有ppoll实现存在问题
3.相关用例需要整理
【修改方案】
1.去掉释放用户空间指针操作
2.更正逻辑错误
3.更正掩码设置与恢复不起作用
4.修复补充现有用例
【影响】
对现有的产品编译不会有影响。

re #I47YWZ

Change-Id: Ib2f60986e9cafb2ea5ef1097ab8552cbb1ede5b4
Signed-off-by: lnlan <lanleinan@163.com>
This commit is contained in:
lnlan
2021-10-30 02:37:42 +00:00
committed by pef
parent 78a297fd4e
commit 2e3bbf1e61
3 changed files with 29 additions and 41 deletions

View File

@@ -218,28 +218,22 @@ void OsSigMaskSwitch(LosTaskCB * const rtcb, sigset_t set)
}
}
int OsSigprocMask(int how, const sigset_t_l *setl, sigset_t_l *oldset)
int OsSigprocMask(int how, const sigset_t_l *setl, sigset_t_l *oldsetl)
{
LosTaskCB *spcb = NULL;
sigset_t oldSigprocmask;
int ret = LOS_OK;
unsigned int intSave;
sigset_t set;
int retVal;
if (setl != NULL) {
retVal = LOS_CopyToKernel(&set, sizeof(sigset_t), &(setl->sig[0]), sizeof(sigset_t));
if (retVal != 0) {
return -EFAULT;
}
}
SCHEDULER_LOCK(intSave);
spcb = OsCurrTaskGet();
/* If requested, copy the old mask to user. */
oldSigprocmask = spcb->sig.sigprocmask;
if (oldsetl != NULL) {
*(sigset_t *)oldsetl = spcb->sig.sigprocmask;
}
/* If requested, modify the current signal mask. */
if (setl != NULL) {
set = *(sigset_t *)setl;
/* Okay, determine what we are supposed to do */
switch (how) {
/* Set the union of the current set and the signal
@@ -267,12 +261,6 @@ int OsSigprocMask(int how, const sigset_t_l *setl, sigset_t_l *oldset)
}
SCHEDULER_UNLOCK(intSave);
if (oldset != NULL) {
retVal = LOS_CopyFromKernel(&(oldset->sig[0]), sizeof(sigset_t), &oldSigprocmask, sizeof(sigset_t));
if (retVal != 0) {
return -EFAULT;
}
}
return ret;
}