This is a note to let you know that I've just added the patch titled
regmap: fix possible ZERO_SIZE_PTR pointer dereferencing error.
to the 3.14-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:
regmap-fix-possible-zero_size_ptr-pointer-dereferencing-error.patch
and it can be found in the queue-3.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From d6b41cb06044a7d895db82bdd54f6e4219970510 Mon Sep 17 00:00:00 2001
From: Xiubo Li <[email protected]>
Date: Sun, 28 Sep 2014 17:09:54 +0800
Subject: regmap: fix possible ZERO_SIZE_PTR pointer dereferencing error.
From: Xiubo Li <[email protected]>
commit d6b41cb06044a7d895db82bdd54f6e4219970510 upstream.
Since we cannot make sure the 'val_count' will always be none zero
here, and then if it equals to zero, the kmemdup() will return
ZERO_SIZE_PTR, which equals to ((void *)16).
So this patch fix this with just doing the zero check before calling
kmemdup().
Signed-off-by: Xiubo Li <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/base/regmap/regmap.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1557,6 +1557,9 @@ int regmap_bulk_write(struct regmap *map
} else {
void *wval;
+ if (!val_count)
+ return -EINVAL;
+
wval = kmemdup(val, val_count * val_bytes, GFP_KERNEL);
if (!wval) {
ret = -ENOMEM;
Patches currently in stable-queue which might be from [email protected] are
queue-3.14/regmap-fix-possible-zero_size_ptr-pointer-dereferencing-error.patch
queue-3.14/regmap-debugfs-fix-possbile-null-pointer-dereference.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html