Skip to contentSkip to conversation

patch "staging: greybus: power_supply: fix prop-descriptor request size" added to staging-testing

PATCH [email protected] 1 participant 1 message Apr 16, 2019

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

staging: greybus: power_supply: fix prop-descriptor request size

to my staging git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
in the staging-testing branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will be merged to the staging-next branch sometime soon, after it passes testing, and the merge window is open.

If you have any questions about this process, please let me know.

From 47830c1127ef166af787caf2f871f23089610a7f Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Thu, 4 Apr 2019 08:53:30 +0200
Subject: staging: greybus: power_supply: fix prop-descriptor request size

Since moving the message buffers off the stack, the dynamically allocated get-prop-descriptor request buffer is incorrectly sized due to using the pointer rather than request-struct size when creating the operation.

Fortunately, the pointer size is always larger than this one-byte request, but this could still cause trouble on the remote end due to the unexpected message size.

Fixes 9d15134d067e ("greybus: power_supply: rework get descriptors")
Cc stable <[email protected]> # 4.9
Cc Rui Miguel Silva <[email protected]>
---
 drivers/staging/greybus/power_supply.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/power_supply.c +1 -1
index 0529e5628c24..ae5c0285a942 100644
@@ -520,7 +520,7 @@ static int gb_power_supply_prop_descriptors_get(struct gb_power_supply *gbpsy)
 
 	op = gb_operation_create(connection,
 				 GB_POWER_SUPPLY_TYPE_GET_PROP_DESCRIPTORS,
-				 sizeof(req), sizeof(*resp) + props_count *
+				 sizeof(*req), sizeof(*resp) + props_count *
 				 sizeof(struct gb_power_supply_props_desc),
 				 GFP_KERNEL);
 	if (!op)
Signature · 1 line
2.21.0