From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ananth N Mavinakayanahalli Date: Thu, 25 Mar 2004 04:32:50 +0000 Subject: Re: [PATCH] SEGV in libsysfs/dlist.c Message-Id: <20040325050952.GA5842@in.ibm.com> List-Id: References: <405992E7.3070105@suse.de> In-Reply-To: <405992E7.3070105@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Wed, Mar 24, 2004 at 03:15:06PM -0800, Greg KH wrote: > On Thu, Mar 18, 2004 at 01:15:35PM +0100, Hannes Reinecke wrote: > > Hi all, Greg, > > > > libsysfs/dlist.c: _dlist_mark_move() > > > > is missing checks for empty lists and may (and indeed, does) crash when > > called with empty dlists. > > What code causes this to happen? udev? If so, where? > When a "get" function is called for obtaining a list, (of say, attirbutes) it returns a NULL either because it was not able to retrieve the data from sysfs (in which case the errno is set appropriately) or if the list is NULL (because there are no elements exposed thru' sysfs), in which case the errno is "0". If the list is not checked to be NULL, there is a possibility of a de-referencing a NULL pointer. Libsysfs takes care of this situation internally. With Dr. Hannes' patch, we do not have to bother of segfaulting even if a NULL is passed. Thanks, Ananth ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel