Merge from OpenSolaris (22-Apr-2008):

6823388 DTrace ioctl handlers must validate all structure members

MFC after:	1 week
This commit is contained in:
Pedro F. Giffuni 2014-07-03 19:07:37 +00:00
parent b560f3ffa1
commit 87e109c3e0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=268230
2 changed files with 4 additions and 2 deletions

View File

@ -12908,7 +12908,8 @@ dtrace_dof_copyin(uintptr_t uarg, int *errp)
dof = kmem_alloc(hdr.dofh_loadsz, KM_SLEEP);
if (copyin((void *)uarg, dof, hdr.dofh_loadsz) != 0) {
if (copyin((void *)uarg, dof, hdr.dofh_loadsz) != 0 ||
dof->dofh_loadsz != hdr.dofh_loadsz) {
kmem_free(dof, hdr.dofh_loadsz);
*errp = EFAULT;
return (NULL);

View File

@ -2277,7 +2277,8 @@ fasttrap_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int fflag,
probe = kmem_alloc(size, KM_SLEEP);
if (copyin(uprobe, probe, size) != 0) {
if (copyin(uprobe, probe, size) != 0 ||
probe->ftps_noffs != noffs) {
kmem_free(probe, size);
return (EFAULT);
}