Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0CEFC10F13 for ; Tue, 16 Apr 2019 11:48:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AFACB20821 for ; Tue, 16 Apr 2019 11:48:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555415283; bh=TCUIuk+/D5S6hnOloV4CouwCzLOT83P3PU+b6XLzJmY=; h=Subject:To:From:Date:List-ID:From; b=0zFE2DQPX7yVLz1sW4+E0156d+8B5J6gWEp8wuQVsXw7L6eOIG47v5GytE+dh8lE6 klQjPmsuaocRlOD4htphqmQ6A3c33jfIcKgwIpCv+sA5zbHr+fMeVDiDmwKPw+8/oU yLI5QRP4mt+Huyt7vsar3+YiqMd3Jb6dLzPsYngo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728147AbfDPLsC (ORCPT ); Tue, 16 Apr 2019 07:48:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:57300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728268AbfDPLsB (ORCPT ); Tue, 16 Apr 2019 07:48:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4C94F20821; Tue, 16 Apr 2019 11:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555415280; bh=TCUIuk+/D5S6hnOloV4CouwCzLOT83P3PU+b6XLzJmY=; h=Subject:To:From:Date:From; b=Rn1CouMGK7rTHqJ+RTcDTech9EulDfTmbnh/aslru/cb1icBJi6S1RdAegeuTZVEv zqde7LY4F+uaMtB+l0GXXGzYrFwn+5RJX3wQimXs5v3wxHxkeOMUc6cstTStw9UNED c+KONFY7hGwSW/1jY591xkdTG+OS6NtfHr/qhH0U= Subject: patch "staging: greybus: power_supply: fix prop-descriptor request size" added to staging-testing To: johan@kernel.org, gregkh@linuxfoundation.org, rmfrfs@gmail.com, rui.silva@linaro.org, stable@vger.kernel.org From: Date: Tue, 16 Apr 2019 13:23:07 +0200 Message-ID: <155541378775157@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 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 # 4.9 Cc: Rui Miguel Silva Signed-off-by: Johan Hovold Reviewed-by: Rui Miguel Silva Signed-off-by: Greg Kroah-Hartman --- 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