From: Greg KH <greg@kroah.com>
To: Jean Delvare <khali@linux-fr.org>
Cc: sensors@Stimpy.netroedge.com, linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@osdl.org>,
Sergey Vlasov <vsu@altlinux.ru>
Subject: Re: [PATCH 2.6] I2C: Prevent buffer overflow on SMBus block read in i2c-viapro
Date: Tue, 1 Feb 2005 00:22:41 -0800 [thread overview]
Message-ID: <20050201082241.GA22023@kroah.com> (raw)
In-Reply-To: <btE2IXvS.1106731047.5606340.khali@localhost>
On Wed, Jan 26, 2005 at 10:17:27AM +0100, Jean Delvare wrote:
>
> Hi Greg, all,
>
> > Hm, all distros leave the i2c-dev /dev nodes writable only by root, so
> > this isn't that "big" of an issue.
>
> Agreed. Non-root write access to these devices would probably be a
> security issue per se anyway, buffer overflow or not. However, I can't
> tell if e.g. some embedded systems wouldn't set a particular group on
> these device files and allow write access to this group, so as to allow
> some daemon to write data to an EEPROM or something similar. This is why
> I thought I better warn and push the patch upstream. I wasn't exactly
> requesting 2.6.10.1 to be released ;)
>
> On second thought, I doubt that embedded designs would rely on a VIA Pro
> chip anyway. But you never know.
>
> > > @@ -268,6 +268,8 @@
> > > break;
> > > case VT596_BLOCK_DATA:
> > > data->block[0] = inb_p(SMBHSTDAT0);
> > > + if (data->block[0] > I2C_SMBUS_BLOCK_MAX)
> > > + data->block[0] = I2C_SMBUS_BLOCK_MAX;
> >
> > But data->block[0] just came from the hardware, right? Not from a user.
>
> True, except that with a write access to the device file and depending on
> the client chip, the user might have just programmed the chip for it to
> answer with this specific value. See right below.
>
> > Now if we have broken hardware, then we might have a problem here, but
> > otherwise I don't see it as a security issue right now.
>
> It doesn't take broken hardware.
>
> (Warning: I am going technical at this point, people not interested in
> the gory details of the I2C and SMBus protocols should better stop here
> ;))
<snip>
Thanks for the good description. I've applied your patch to my trees
and will push it upward soon.
thanks,
greg k-h
prev parent reply other threads:[~2005-02-01 8:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-25 22:03 [PATCH 2.6] I2C: Prevent buffer overflow on SMBus block read in i2c-viapro Jean Delvare
2005-01-25 22:42 ` Greg KH
2005-01-26 9:17 ` Jean Delvare
2005-02-01 8:22 ` Greg KH [this message]
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=20050201082241.GA22023@kroah.com \
--to=greg@kroah.com \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sensors@Stimpy.netroedge.com \
--cc=torvalds@osdl.org \
--cc=vsu@altlinux.ru \
/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