linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] SEGV in libsysfs/dlist.c
Date: Thu, 25 Mar 2004 04:32:50 +0000	[thread overview]
Message-ID: <20040325050952.GA5842@in.ibm.com> (raw)
In-Reply-To: <405992E7.3070105@suse.de>

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_id\x1470&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

  parent reply	other threads:[~2004-03-25  4:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-18 12:15 [PATCH] SEGV in libsysfs/dlist.c Hannes Reinecke
2004-03-24 23:15 ` Greg KH
2004-03-25  4:32 ` Ananth N Mavinakayanahalli [this message]
2004-03-31 22:58 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040325050952.GA5842@in.ibm.com \
    --to=ananth@in.ibm.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).