Skip to contentSkip to conversation

Patch "PowerCap: Fix an error code in powercap_register_zone()" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Apr 10, 2018

Subsystems (2)
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

PowerCap: Fix an error code in powercap_register_zone()

to the 4.4-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:
powercap-fix-an-error-code-in-powercap_register_zone.patch
and it can be found in the queue-4.4 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 foo@baz Tue Apr 10 10:31:53 CEST 2018

From: Dan Carpenter <[email protected]>
Date: Wed, 10 May 2017 22:40:06 +0300
Subject: PowerCap: Fix an error code in powercap_register_zone()

From: Dan Carpenter <[email protected]>

[ Upstream commit 216c4e9db4c9d1d2a382b42880442dc632cd47d9 ]

In the current code we accidentally return the successful result from idr_alloc() instead of a negative error pointer. The caller is looking for an error pointer and so it treats the returned value as a valid pointer.

This one might be a bit serious because if it lets people get around the kernel's protection for remapping NULL. I'm not sure.

---
 drivers/powercap/powercap_sys.c |    1 +
 1 file changed, 1 insertion(+)
drivers/powercap/powercap_sys.c +1 -0
@@ -538,6 +538,7 @@ struct powercap_zone *powercap_register_
 
 	power_zone->id = result;
 	idr_init(&power_zone->idr);
+	result = -ENOMEM;
 	power_zone->name = kstrdup(name, GFP_KERNEL);
 	if (!power_zone->name)
 		goto err_name_alloc;

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

queue-4.4/block-fix-an-error-code-in-add_partition.patch queue-4.4/pnfs-flexfiles-missing-error-code-in-ff_layout_alloc_lseg.patch queue-4.4/drivers-misc-vmw_vmci-vmci_queue_pair.c-fix-a-couple-integer-overflow-tests.patch queue-4.4/md-cluster-fix-potential-lock-issue-in-add_new_disk.patch queue-4.4/ipmi_ssif-unlock-on-allocation-failure.patch queue-4.4/powercap-fix-an-error-code-in-powercap_register_zone.patch queue-4.4/libceph-null-deref-on-crush_decode-error-path.patch