lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 4 Apr 2019 08:53:30 +0200 From: Johan Hovold <johan@...nel.org> To: Rui Miguel Silva <rmfrfs@...il.com> Cc: Johan Hovold <johan@...nel.org>, Alex Elder <elder@...nel.org>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, greybus-dev@...ts.linaro.org, devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org, "Gustavo A. R. Silva" <gustavo@...eddedor.com>, stable <stable@...r.kernel.org>, Rui Miguel Silva <rui.silva@...aro.org> Subject: [PATCH] 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 <stable@...r.kernel.org> # 4.9 Cc: Rui Miguel Silva <rui.silva@...aro.org> Signed-off-by: Johan Hovold <johan@...nel.org> --- drivers/staging/greybus/power_supply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/greybus/power_supply.c b/drivers/staging/greybus/power_supply.c index 0529e5628c24..ae5c0285a942 100644 --- a/drivers/staging/greybus/power_supply.c +++ b/drivers/staging/greybus/power_supply.c @@ -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) -- 2.21.0
Powered by blists - more mailing lists