All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcus Folkesson <marcus.folkesson@gmail.com>
To: Colin Ian King <colin.i.king@gmail.com>
Cc: Kent Gustavsson <kent@minoris.se>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: mcp3911: Fix out of bounds access of array mcp3911_osr_table
Date: Wed, 12 Oct 2022 15:52:15 +0200	[thread overview]
Message-ID: <Y0bGjwBBt4LZRACd@gmail.com> (raw)
In-Reply-To: <20221012134245.5345-1-colin.i.king@gmail.com>

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

Hi Colin,

On Wed, Oct 12, 2022 at 02:42:45PM +0100, Colin Ian King wrote:
> Currently the for-loop is using the size of the array mcp3911_osr_table
> as the upper bounds which is 0..31 which is causing an out of bounds
> access to the array at indexes 8..31. Fix this using the ARRAY_SIZE
> macro to get the size of the array in elements rather than bytes.
> 
> Fixes: 6d965885f4ea ("iio: adc: mcp3911: add support for oversampling ratio")
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Thank you for the patch!

Dan was a little bit earlier to catch this though
https://lore.kernel.org/all/20221002132053.113f595f@jic23-huawei/

Best regards,
Marcus Folkesson

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

      reply	other threads:[~2022-10-12 13:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12 13:42 [PATCH] iio: adc: mcp3911: Fix out of bounds access of array mcp3911_osr_table Colin Ian King
2022-10-12 13:52 ` Marcus Folkesson [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=Y0bGjwBBt4LZRACd@gmail.com \
    --to=marcus.folkesson@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=colin.i.king@gmail.com \
    --cc=jic23@kernel.org \
    --cc=kent@minoris.se \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.