PERFORCE change 125277 for review

John Baldwin jhb at freebsd.org
Wed Sep 26 08:48:18 PDT 2007


On Saturday 18 August 2007 04:46:08 am Roman Divacky wrote:
> >       struct image_params *imgp;
> >  {
> >  	int error;
> > +	struct proc *p = imgp->proc; 
> >  	vm_map_t map = &imgp->proc->p_vmspace->vm_map;
> >  	vm_offset_t *addr = &imgp->proc->p_usrsysshm;
> > -	int test = 42;
> > +	struct sysshm outsysshm;
> >  
> >  	error = vm_map_sysshm(map, addr, 42);
> >  
> > -	copyout((caddr_t) &test, (caddr_t) *addr, sizeof(int)); 
> > +	outsysshm.pid = p->p_pid;
> > +	strncpy(outsysshm.progtitle, p->p_comm, MAXCOMLEN);
> > +	strncpy(outsysshm.proctitle, "\0", 1);
> > +	copyout((caddr_t) &outsysshm, (caddr_t) *addr, sizeof(struct sysshm)); 
>   
> 
> the p->p_comm can be changed under your hands. you need to lock "p" and obtain
> local copy and copyout the local copy.

Actually, it is only set during exec() for userland processes, so this is
probably fine.

-- 
John Baldwin


More information about the p4-projects mailing list