public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sesterhenn <snakebyte@gmx.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: markus.lidel@shadowconnect.com
Subject: [Patch] NULL pointer dereference in drivers/message/i2o/i2o_config.c
Date: Tue, 30 May 2006 23:17:02 +0200	[thread overview]
Message-ID: <1149023822.30594.2.camel@alice> (raw)

hi,

i am not sure if there is some black magic which prevents this
from happening, it is spotted by coverity id #265

499  		for (p = open_files; p; p = p->next)
500  			if (p->q_id == (ulong) fp->private_data)
501  				break;
502  	
503  		if (!p->q_len)
504  			return -ENOENT

if we cant find a p with a p->q_id which matches fp->private data,
we dereference it.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>


--- linux-2.6.17-rc4-git2/drivers/message/i2o/i2o_config.c.orig	2006-05-30 23:12:13.000000000 +0200
+++ linux-2.6.17-rc4-git2/drivers/message/i2o/i2o_config.c	2006-05-30 23:13:30.000000000 +0200
@@ -500,7 +500,7 @@ static int i2o_cfg_evt_get(unsigned long
 		if (p->q_id == (ulong) fp->private_data)
 			break;
 
-	if (!p->q_len)
+	if (!p || !p->q_len)
 		return -ENOENT;
 
 	memcpy(&kget.info, &p->event_q[p->q_out], sizeof(struct i2o_evt_info));



                 reply	other threads:[~2006-05-30 21:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1149023822.30594.2.camel@alice \
    --to=snakebyte@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus.lidel@shadowconnect.com \
    /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