* Patch "iio: ad5755: fix off-by-one on devnr limit check" has been added to the 4.8-stable tree
@ 2016-10-28 18:20 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-10-28 18:20 UTC (permalink / raw)
To: colin.king, gregkh, jic23; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
iio: ad5755: fix off-by-one on devnr limit check
to the 4.8-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
iio-ad5755-fix-off-by-one-on-devnr-limit-check.patch
and it can be found in the queue-4.8 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 9d47964bfd471f0dd4c89f28556aec68bffa0020 Mon Sep 17 00:00:00 2001
From: Colin Ian King <colin.king@canonical.com>
Date: Mon, 25 Jul 2016 23:40:01 +0100
Subject: iio: ad5755: fix off-by-one on devnr limit check
From: Colin Ian King <colin.king@canonical.com>
commit 9d47964bfd471f0dd4c89f28556aec68bffa0020 upstream.
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>
Fixes: c947459979c6 ("iio: ad5755: add support for dt bindings")
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/dac/ad5755.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/iio/dac/ad5755.c
+++ b/drivers/iio/dac/ad5755.c
@@ -655,7 +655,7 @@ static struct ad5755_platform_data *ad57
devnr = 0;
for_each_child_of_node(np, pp) {
- if (devnr > AD5755_NUM_CHANNELS) {
+ if (devnr >= AD5755_NUM_CHANNELS) {
dev_err(dev,
"There is to many channels defined in DT\n");
goto error_out;
Patches currently in stable-queue which might be from colin.king@canonical.com are
queue-4.8/iio-ad5755-fix-off-by-one-on-devnr-limit-check.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-10-28 18:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-28 18:20 Patch "iio: ad5755: fix off-by-one on devnr limit check" has been added to the 4.8-stable tree gregkh
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).