Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Dec 2016 18:33:31 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Edward Tomasz Napierala <trasz@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r309891 - head/sys/kern
Message-ID:  <20161212163331.GH54029@kib.kiev.ua>
In-Reply-To: <201612121522.uBCFMMmm088698@repo.freebsd.org>
References:  <201612121522.uBCFMMmm088698@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Dec 12, 2016 at 03:22:22PM +0000, Edward Tomasz Napierala wrote:
> Author: trasz
> Date: Mon Dec 12 15:22:21 2016
> New Revision: 309891
> URL: https://svnweb.freebsd.org/changeset/base/309891
> 
> Log:
>   Avoid dereferencing NULL pointers in devtoname().  I've seen it panic,
>   called from ufs_print() in DDB.
Calls from DDB should not panic even if accessing NULL pointers.

That said, I also do not think that this is the right place to change.
UFS um_dev should not be NULL for any active mount.

>   
>   MFC after:	1 month
> 
> Modified:
>   head/sys/kern/kern_conf.c
> 
> Modified: head/sys/kern/kern_conf.c
> ==============================================================================
> --- head/sys/kern/kern_conf.c	Mon Dec 12 15:17:56 2016	(r309890)
> +++ head/sys/kern/kern_conf.c	Mon Dec 12 15:22:21 2016	(r309891)
> @@ -1230,6 +1230,9 @@ const char *
>  devtoname(struct cdev *dev)
>  {
>  
> +	if (dev == NULL)
> +		return (NULL);
> +
>  	return (dev->si_name);
>  }
>  



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