Patch "mfd: tps65910: Fix possible invalid pointer dereference on regmap_add_irq_chip fail" has been added to the 3.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    mfd: tps65910: Fix possible invalid pointer dereference on regmap_add_irq_chip fail

to the 3.10-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:
     mfd-tps65910-fix-possible-invalid-pointer-dereference-on-regmap_add_irq_chip-fail.patch
and it can be found in the queue-3.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 483e2dfdbc94751430e41db9973985f5b054d322 Mon Sep 17 00:00:00 2001
From: Krzysztof Kozlowski <k.kozlowski@xxxxxxxxxxx>
Date: Wed, 12 Mar 2014 16:50:44 +0100
Subject: mfd: tps65910: Fix possible invalid pointer dereference on regmap_add_irq_chip fail

From: Krzysztof Kozlowski <k.kozlowski@xxxxxxxxxxx>

commit 483e2dfdbc94751430e41db9973985f5b054d322 upstream.

Fixes: 4aab3fadad32 ("mfd: tps65910: Move interrupt implementation code to mfd file")

tps65910_irq_init() sets 'tps65910->chip_irq' before calling
regmap_add_irq_chip(). If the regmap_add_irq_chip() call fails in
memory allocation of regmap_irq_chip_data members then:

1. The 'tps65910->chip_irq' will still hold some value
2. 'tps65910->irq_data' will be pointing to already freed memory
   (because regmap_add_irq_chip() will free it on error)

This results in invalid memory access during driver remove because the
tps65910_irq_exit() tests whether 'tps65910->chip_irq' is not zero.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@xxxxxxxxxxx>
Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 drivers/mfd/tps65910.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -254,8 +254,10 @@ static int tps65910_irq_init(struct tps6
 	ret = regmap_add_irq_chip(tps65910->regmap, tps65910->chip_irq,
 		IRQF_ONESHOT, pdata->irq_base,
 		tps6591x_irqs_chip, &tps65910->irq_data);
-	if (ret < 0)
+	if (ret < 0) {
 		dev_warn(tps65910->dev, "Failed to add irq_chip %d\n", ret);
+		tps65910->chip_irq = 0;
+	}
 	return ret;
 }
 


Patches currently in stable-queue which might be from k.kozlowski@xxxxxxxxxxx are

queue-3.10/mfd-max8998-fix-possible-null-pointer-dereference-on-i2c_new_dummy-error.patch
queue-3.10/mfd-tps65910-fix-possible-invalid-pointer-dereference-on-regmap_add_irq_chip-fail.patch
queue-3.10/mfd-88pm860x-fix-i2c-device-resource-leak-on-regmap-init-fail.patch
queue-3.10/mfd-88pm860x-fix-possible-null-pointer-dereference-on-i2c_new_dummy-error.patch
queue-3.10/mfd-max77686-fix-possible-null-pointer-dereference-on-i2c_new_dummy-error.patch
queue-3.10/mfd-max8925-fix-possible-null-pointer-dereference-on-i2c_new_dummy-error.patch
queue-3.10/mfd-max77693-fix-possible-null-pointer-dereference-on-i2c_new_dummy-error.patch
queue-3.10/mfd-sec-core-fix-possible-null-pointer-dereference-when-i2c_new_dummy-error.patch
queue-3.10/mfd-max8997-fix-possible-null-pointer-dereference-on-i2c_new_dummy-error.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]