mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Shaun Colley" <shaunige@yahoo.co.uk>
To: linux-kernel@vger.kernel.org
Cc: Greg KH <greg@kroah.com>
Subject: Re: i2c device driver bugs
Date: Tue, 15 Jun 2004 16:39:20 +0100 (BST)	[thread overview]
Message-ID: <20040615153920.24928.qmail@web25105.mail.ukl.yahoo.com> (raw)
In-Reply-To: <20040614212130.GA3292@kroah.com>

Hi Greg,

> Please let us know exactly what kernel version you
> see this in.  It
> looks to me that it is fixed in the latest 2.4 and
> 2.6 versions.  If you
> do not think so, please let us know.

I was actually looking at a fairly old version of the
source tree (2.4.19, 2.4.20) -- it appears that a
quick fix fixed this vulnerability in 2.4.21:

http://lxr.linux.no/diff/drivers/i2c/i2c-dev.c?diffval=2.4.21;diffvar=v

If you scroll down a bit, you should see:

---
if (rdwr_arg.nmsgs > 42)
          return -EINVAL;
---

It looks like a quick sanity check was added in the
'I2C_RDWR' option, to fix the issue.

I'm downloading the 2.4.21 patch to check if the
fixing of this was recorded, or whether it was
silently fixed (looks like it was).

Confirmed.  2.4.21 fixed the bug:

---
[shaun@cpc2-mars1-3-0-cust191 shaun]$ grep -n -A 10
"sent at once" * 
patch-2.4.21:162276:+		 * be sent at once */
patch-2.4.21-162277-+		if (rdwr_arg.nmsgs > 42)
patch-2.4.21-162278-+			return -EINVAL;
patch-2.4.21-162279-+		
patch-2.4.21-162280- 		rdwr_pa = (struct i2c_msg *)
patch-2.4.21-162281- 			kmalloc(rdwr_arg.nmsgs *
sizeof(struct i2c_msg), 
patch-2.4.21-162282- 			GFP_KERNEL);
patch-2.4.21-162283-@@ -270,6 +275,11 @@
patch-2.4.21-162284- 			        res = -EFAULT;
patch-2.4.21-162285- 				break;
patch-2.4.21-162286- 			}
[shaun@cpc2-mars1-3-0-cust191 shaun]$ 
---


It's also fixed in all versions of 2.6...

However, the vulnerbility seems to still be present in
2.5 -- latest version.  

So, to sum it up:

- Not present in 2.2, because the driver wasn't
implemented as fully as it is now.
- Present in 2.4 versions 2.4.20 and below.
- Present in 2.5
- Not present in 2.6



As for the second bug, it's fixed in 2.4.9, 2.5, and
2.6.



Thank you for your time.
Shaun.



	
	
		
___________________________________________________________ALL-NEW Yahoo! Messenger - sooooo many all-new ways to express yourself http://uk.messenger.yahoo.com

  reply	other threads:[~2004-06-15 15:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-13 18:41 Shaun Colley
2004-06-14 21:21 ` Greg KH
2004-06-15 15:39   ` Shaun Colley [this message]
2004-06-15 16:13     ` Greg KH
2004-06-15 16:33       ` Shaun Colley
     [not found]       ` <20040615163244.10651.qmail@web25103.mail.ukl.yahoo.com>
2004-06-15 16:36         ` Greg KH
2004-06-15 17:09           ` Shaun Colley
2004-06-17 23:56             ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2004-06-13 10:31 Shaun Colley

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=20040615153920.24928.qmail@web25105.mail.ukl.yahoo.com \
    --to=shaunige@yahoo.co.uk \
    --cc=greg@kroah.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®