From mboxrd@z Thu Jan 1 00:00:00 1970 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 35F88C10F13 for ; Tue, 16 Apr 2019 18:29:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 021C32075B for ; Tue, 16 Apr 2019 18:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555439354; bh=kYiQzbTKTUFyNAMcRcuQuR+mjgzQqna7fALJQBiYZ7E=; h=Subject:To:From:Date:List-ID:From; b=m33uPfTnZQ2R556y4f9P/AU6ODY5lGlryr5bw6YKiX8X20I8trhqEmMpAOT9CKkBJ zKnP4zJxGqhjNmL2SLHjws8qgE6eiy+EPUAC1ouQ5hkJLLEK/DhQK2s9pMT5JQJqao nWjxmX6jaH6r0wO3VlUCl878w1e4izFiYfSwcsKI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729897AbfDPS3N (ORCPT ); Tue, 16 Apr 2019 14:29:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:34794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727136AbfDPS3N (ORCPT ); Tue, 16 Apr 2019 14:29:13 -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 2D59420449; Tue, 16 Apr 2019 18:29:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555439352; bh=kYiQzbTKTUFyNAMcRcuQuR+mjgzQqna7fALJQBiYZ7E=; h=Subject:To:From:Date:From; b=ycUcHUViieSBekLsnsm9WDPp30VwJlY+aCwQCu8V9iEKMypl+OfrbnpMKwxG7UaCZ xyjwnZQr/Hr3nPaDcGDj8JNDXKYvli+eVTC/WH1dK+bMq2RzD2uVatSSVfTLWkCn9A vXJesnRreZpsJoZb8FWI3QnzsTd+gX4vec411a4Y= Subject: patch "staging: greybus: power_supply: fix prop-descriptor request size" added to staging-next To: johan@kernel.org, gregkh@linuxfoundation.org, rmfrfs@gmail.com, rui.silva@linaro.org, stable@vger.kernel.org From: Date: Tue, 16 Apr 2019 20:28:56 +0200 Message-ID: <155543933617990@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-next 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 also be merged in the next major kernel release during the merge window. 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