Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Sep 2014 10:55:23 +0200
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        Gleb Smirnoff <glebius@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r270999 - head/sys/kern
Message-ID:  <20140903085523.GB13871@dft-labs.eu>
In-Reply-To: <201409030814.s838E7A2084257@svn.freebsd.org>
References:  <201409030814.s838E7A2084257@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 03, 2014 at 08:14:07AM +0000, Gleb Smirnoff wrote:
> Author: glebius
> Date: Wed Sep  3 08:14:07 2014
> New Revision: 270999
> URL: http://svnweb.freebsd.org/changeset/base/270999
> 
> Log:
>   Fix dereference after NULL check.
>   
>   CID:		1234607
>   Sponsored by:	Nginx, Inc.
> 
> Modified:
>   head/sys/kern/kern_proc.c
> 
> Modified: head/sys/kern/kern_proc.c
> ==============================================================================
> --- head/sys/kern/kern_proc.c	Wed Sep  3 08:13:46 2014	(r270998)
> +++ head/sys/kern/kern_proc.c	Wed Sep  3 08:14:07 2014	(r270999)
> @@ -921,10 +921,11 @@ fill_kinfo_proc_only(struct proc *p, str
>  	kp->ki_xstat = p->p_xstat;
>  	kp->ki_acflag = p->p_acflag;
>  	kp->ki_lock = p->p_lock;
> -	if (p->p_pptr)
> +	if (p->p_pptr) {
>  		kp->ki_ppid = proc_realparent(p)->p_pid;
> -	if (p->p_flag & P_TRACED)
> -		kp->ki_tracer = p->p_pptr->p_pid;
> +		if (p->p_flag & P_TRACED)
> +			kp->ki_tracer = p->p_pptr->p_pid;
> +	}
>  }
>  
>  /*
> 

p_pptr must be non-NULL if P_TRACED is set. If there is no way to
annotate it for coverity, this change deserves a comment in the code
(and in retrospect previous code should have had appropriate comment as
well).

-- 
Mateusz Guzik <mjguzik gmail.com>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140903085523.GB13871>