public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: michael.hennerich@analog.com,
	Colin King <colin.king@canonical.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	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: dac: fix off-by-one comparison and out-of-bounds write
Date: Fri, 3 Jun 2016 13:00:45 +0100	[thread overview]
Message-ID: <fcebdfbd-6d81-7e5a-4a85-27d41a4ea280@kernel.org> (raw)
In-Reply-To: <57501038.1070207@analog.com>

On 02/06/16 11:53, Michael Hennerich wrote:
> On 06/02/2016 12:06 PM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The check on reg is off-by-one, it should be >= rather than >. Fix
>> this to stop an out-of-bounds write to st->channel_modes[reg].
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> 
> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Already have a fix queued from the 29th of April - will push out
in the next few days.  It just managed to miss going out in the
last cycle by a few days.

Thanks,

Jonathan

> 
>> ---
>>   drivers/iio/dac/ad5592r-base.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-base.c
>> index 948f600..69bde59 100644
>> --- a/drivers/iio/dac/ad5592r-base.c
>> +++ b/drivers/iio/dac/ad5592r-base.c
>> @@ -525,7 +525,7 @@ static int ad5592r_alloc_channels(struct ad5592r_state *st)
>>
>>       device_for_each_child_node(st->dev, child) {
>>           ret = fwnode_property_read_u32(child, "reg", &reg);
>> -        if (ret || reg > ARRAY_SIZE(st->channel_modes))
>> +        if (ret || reg >= ARRAY_SIZE(st->channel_modes))
>>               continue;
>>
>>           ret = fwnode_property_read_u32(child, "adi,mode", &tmp);
>>
> 
> 

      reply	other threads:[~2016-06-03 12:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-02 10:06 [PATCH] iio: dac: fix off-by-one comparison and out-of-bounds write Colin King
2016-06-02 10:53 ` Michael Hennerich
2016-06-03 12:00   ` 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=fcebdfbd-6d81-7e5a-4a85-27d41a4ea280@kernel.org \
    --to=jic23@kernel.org \
    --cc=colin.king@canonical.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --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