Skip to contentSkip to conversation

Patch "PM / QoS: return -EINVAL for bogus strings" has been added to the 4.11-stable tree

PATCH [email protected] 1 participant 1 message Jul 19, 2017

Subsystems (5)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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

PM / QoS: return -EINVAL for bogus strings

to the 4.11-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:
pm-qos-return-einval-for-bogus-strings.patch
and it can be found in the queue-4.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 2ca30331c156ca9e97643ad05dd8930b8fe78b01 Mon Sep 17 00:00:00 2001

From: Dan Carpenter <[email protected]>
Date: Mon, 10 Jul 2017 10:21:40 +0300
Subject: PM / QoS: return -EINVAL for bogus strings

From: Dan Carpenter <[email protected]>

commit 2ca30331c156ca9e97643ad05dd8930b8fe78b01 upstream.

In the current code, if the user accidentally writes a bogus command to this sysfs file, then we set the latency tolerance to an uninitialized variable.

Fixes 2d984ad132a8 (PM / QoS: Introcuce latency tolerance device PM QoS type)
---
 drivers/base/power/sysfs.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/base/power/sysfs.c +2 -0
@@ -272,6 +272,8 @@ static ssize_t pm_qos_latency_tolerance_
 			value = PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT;
 		else if (!strcmp(buf, "any") || !strcmp(buf, "any\n"))
 			value = PM_QOS_LATENCY_ANY;
+		else
+			return -EINVAL;
 	}
 	ret = dev_pm_qos_update_user_latency_tolerance(dev, value);
 	return ret < 0 ? ret : n;

Patches currently in stable-queue which might be from [email protected] are

queue-4.11/rocker-move-dereference-before-free.patch queue-4.11/pm-qos-return-einval-for-bogus-strings.patch