mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-18 10:35:55 +00:00
Fix Giant leakage in several error cases in __semctl().
This commit is contained in:
parent
6bd7ad69a1
commit
4a7d6cd251
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=91417
@ -494,14 +494,14 @@ __semctl(td, uap)
|
||||
switch(cmd) {
|
||||
case SEM_STAT:
|
||||
if (semid < 0 || semid >= seminfo.semmsl)
|
||||
return(EINVAL);
|
||||
UGAR(EINVAL);
|
||||
semaptr = &sema[semid];
|
||||
if ((semaptr->sem_perm.mode & SEM_ALLOC) == 0 )
|
||||
return(EINVAL);
|
||||
UGAR(EINVAL);
|
||||
if ((error = ipcperm(td, &semaptr->sem_perm, IPC_R)))
|
||||
return(error);
|
||||
UGAR(error);
|
||||
if ((error = copyin(arg, &real_arg, sizeof(real_arg))) != 0)
|
||||
return(error);
|
||||
UGAR(error);
|
||||
error = copyout((caddr_t)semaptr, real_arg.buf,
|
||||
sizeof(struct semid_ds));
|
||||
rval = IXSEQ_TO_IPCID(semid,semaptr->sem_perm);
|
||||
|
Loading…
Reference in New Issue
Block a user