linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@jic23.retrosnub.co.uk>
To: Dan Murphy <dmurphy@ti.com>
Cc: "Vincent Stehlé" <vincent.stehle@laposte.net>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Jonathan Cameron" <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH] iio: adc: ads124: avoid buffer overflow
Date: Sun, 7 Apr 2019 13:03:16 +0100	[thread overview]
Message-ID: <20190407130316.2ff07791@archlinux> (raw)
In-Reply-To: <20190407130242.6699b510@archlinux>

On Sun, 7 Apr 2019 13:02:42 +0100
Jonathan Cameron <jic23@jic23.retrosnub.co.uk> wrote:

> On Mon, 1 Apr 2019 07:41:37 -0500
> Dan Murphy <dmurphy@ti.com> wrote:
> 
> > On 3/31/19 1:54 PM, Vincent Stehlé wrote:  
> > > When initializing the priv->data array starting from index 1, there is one
> > > less element to consider than when initializing the full array.
> > > 
> > > Fixes: e717f8c6dfec8f76 ("iio: adc: Add the TI ads124s08 ADC code")
> > > Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
> > > Cc: Dan Murphy <dmurphy@ti.com>
> > > Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > > ---
> > >  drivers/iio/adc/ti-ads124s08.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/iio/adc/ti-ads124s08.c b/drivers/iio/adc/ti-ads124s08.c
> > > index 53f17e4f2f230..552c2be8d87ad 100644
> > > --- a/drivers/iio/adc/ti-ads124s08.c
> > > +++ b/drivers/iio/adc/ti-ads124s08.c
> > > @@ -202,7 +202,7 @@ static int ads124s_read(struct iio_dev *indio_dev, unsigned int chan)
> > >  	};
> > >  
> > >  	priv->data[0] = ADS124S08_CMD_RDATA;
> > > -	memset(&priv->data[1], ADS124S08_CMD_NOP, sizeof(priv->data));
> > > +	memset(&priv->data[1], ADS124S08_CMD_NOP, sizeof(priv->data) - 1);
> > >  
> > >  	ret = spi_sync_transfer(priv->spi, t, ARRAY_SIZE(t));
> > >  	if (ret < 0)
> > >     
> > 
> > Reviewed-by: Dan Murphy <dmurphy@ti.com>  
> 
> Applied to the fixes-togreg branch of iio.git and pushed out as testing
> for the autobuilders to play with it.
Wrong finger memory. Not pushed out as testing. Pushed out as fixes-togreg!

Jonathan
> 
> Thanks,
> 
> Jonathan


      reply	other threads:[~2019-04-07 12:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-31 18:54 [PATCH] iio: adc: ads124: avoid buffer overflow Vincent Stehlé
2019-04-01  8:32 ` Mukesh Ojha
2019-04-01 12:41 ` Dan Murphy
2019-04-07 12:02   ` Jonathan Cameron
2019-04-07 12:03     ` Jonathan Cameron [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=20190407130316.2ff07791@archlinux \
    --to=jic23@jic23.retrosnub.co.uk \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=dmurphy@ti.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vincent.stehle@laposte.net \
    /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).