Linux I2C development
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: "Compostella, Jeremy" <jeremy.compostella@intel.com>
Cc: linux-i2c@vger.kernel.org
Subject: Re: [PATCH] i2c: core-smbus: prevent stack corruption on read I2C_BLOCK_DATA
Date: Mon, 27 Nov 2017 19:38:47 +0100	[thread overview]
Message-ID: <20171127183847.ddatx2r5dnmrs3rl@ninjato> (raw)
In-Reply-To: <871skzpbby.fsf@jcompost-mobl.amr.corp.intel.com>

[-- Attachment #1: Type: text/plain, Size: 765 bytes --]

On Wed, Nov 15, 2017 at 12:54:09PM -0700, Compostella, Jeremy wrote:
> On a I2C_SMBUS_I2C_BLOCK_DATA read request, if data->block[0] is
> greater than I2C_SMBUS_BLOCK_MAX + 1, the underlying I2C driver writes
> data out of the msgbuf1 boundary.
> 
> It is possible from a user application to run into that issue by call
> the I2C_SMBUS ioctl with data.block[0] greater than
> I2C_SMBUS_BLOCK_MAX + 1.

From Documentation/i2c/dev-interface:

ioctl(file, I2C_SMBUS, struct i2c_smbus_ioctl_data *args)
  Not meant to be called  directly; instead, use the access functions
  below.

Maybe we should add this info to the include file as well?

But I guess we still shouldn't OOPS on this misuse...

Will think about it...

Regards,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-11-27 18:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15 19:54 [PATCH] i2c: core-smbus: prevent stack corruption on read I2C_BLOCK_DATA Compostella, Jeremy
2017-11-27 18:38 ` Wolfram Sang [this message]
2017-11-27 19:14   ` Compostella, Jeremy
2018-01-15 17:59 ` Wolfram Sang
2018-01-16 19:42   ` Compostella, Jeremy
2018-01-17 14:37     ` Wolfram Sang

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=20171127183847.ddatx2r5dnmrs3rl@ninjato \
    --to=wsa@the-dreams.de \
    --cc=jeremy.compostella@intel.com \
    --cc=linux-i2c@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