linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Jonathan Cameron <jic23@kernel.org>,
	Colin King <colin.king@canonical.com>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: ad5755: fix off-by-one on devnr limit check
Date: Sun, 21 Aug 2016 22:07:33 +0200	[thread overview]
Message-ID: <3ed48869-735a-002b-d89e-b1a694d19b6e@metafoo.de> (raw)
In-Reply-To: <1efdfc25-b13d-c383-2346-75b414b32081@kernel.org>

On 08/21/2016 09:30 PM, Jonathan Cameron wrote:
> On 25/07/16 23:40, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The comparison for devnr limits is off-by-one, the current check
>> allows 0 to AD5755_NUM_CHANNELS and the limit should be in fact
>> 0 to AD5755_NUM_CHANNELS - 1.  This can lead to an out of bounds
>> write to pdata->dac[devnr]. Fix this by replacing > with >= on the
>> comparison.
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Lars? 
> 
> Looks correct to me.
> 
> I'd also like a fixes tag for this if possible.  Guessing it
> might well be the original driver introduction but best to be
> sure ;)

It's new in 4.8-rc1. It was introduced by the devictree support patch.

Fixes: c947459979c6 ("iio: ad5755: add support for dt bindings")


  reply	other threads:[~2016-08-21 20:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-25 22:40 [PATCH] iio: ad5755: fix off-by-one on devnr limit check Colin King
2016-08-21 19:30 ` Jonathan Cameron
2016-08-21 20:07   ` Lars-Peter Clausen [this message]
2016-08-29 15:16     ` Jonathan Cameron

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=3ed48869-735a-002b-d89e-b1a694d19b6e@metafoo.de \
    --to=lars@metafoo.de \
    --cc=Michael.Hennerich@analog.com \
    --cc=colin.king@canonical.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.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).