Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1171996yba; Thu, 9 May 2019 11:57:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHVutP7Y4/tLsrPJAV8WtdJ/jfAEA+1JzNyQ1VjdFbCxT4iWJGI97VW6ehBLtxQbC4Jsfk X-Received: by 2002:a63:b48:: with SMTP id a8mr7446668pgl.368.1557428272026; Thu, 09 May 2019 11:57:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557428272; cv=none; d=google.com; s=arc-20160816; b=T0IrNF90IRjJqnA7EwdrQKeMmpVkUJN4IyJOoaGJ+kaDhGt7gMS0tadiFFmhv5ghej +6c+5Wat5L9uVxm7IuC5IZnwVu/rgNZF557aJ7jzQJCwst2qZZzpOYx4PrBtyWwbCWwA F79wElovjYNBhQDTUjFC3wfBM636h6KDR8+c+WSJ8pQDgVXZhfK569xedNAexu6JoLYt t48uI0qtllfv9cbSkfo0bsj7/oxOb/l1vDtEuLhuUwFO7aWuD2wL3+GwOfTFVKWuzK4/ dB6JZhQyT97kA52vEpHVdWk+9onPvWH7/PFaCrHkeBMAiM1vTbdgR3se5AonV0lsg6s/ HFcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/WfTo9zwlOpvTK9JIyXDRgKjwR2Str8oPLjc02jSh8w=; b=DRDB9aTLNBUWGEhC5SVj9cdKyaP7m/0ycWRkha4iLOUCaLuIkexn/I8C7ztNR4LuRW 7fTSKFUxCjSiZ/5LEoOSq2FIIOFtnsYvhmhBbnkNBoJmug8nImal2HguPitEVKHlGQIg 4DLPpAf0uA7IN+FDiWZ5qyz1/+WFUmsf0jLYaEPxWwpl/WoxJOCfEi4/FoDEKExI8EFS 65HFL8qWOu4q2USMjqK928M+W/lusezjRqPx5ZFlZK3Vzy1E71a2atlFtLhB0u4gWI9e XtGdiJP2mQhRpa7kwLSxQw+B4+4PrVj+70lxvRzjTRKiIhnXen+crwOwfLTrIZpD8Gm0 T0jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PNSHXZ4n; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c13si4107498pgq.322.2019.05.09.11.57.36; Thu, 09 May 2019 11:57:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PNSHXZ4n; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729104AbfEIS41 (ORCPT + 99 others); Thu, 9 May 2019 14:56:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:50022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728919AbfEISzA (ORCPT ); Thu, 9 May 2019 14:55:00 -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 6331F217D6; Thu, 9 May 2019 18:54:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557428099; bh=GnB4mLSRRipVoJKGB3Hsztd53ht23uQOmOMWNCqXfsg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PNSHXZ4n3k8iugyg9w+PJxBA2Se1Wv1DH3iJDKarlXx7Z2o7olxlI68O5mipNzB8v bG0ExrZ3L7pCF1lVOg72YIpCXoQrdGrfLfzGo8FzARYm/nM/x0GzL3shQC+cTAKR5a wSpJH+IUmvCvNeWxP5rpXJkQGmDzH/G/9qXqvArs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rui Miguel Silva , Johan Hovold , Rui Miguel Silva Subject: [PATCH 5.1 03/30] staging: greybus: power_supply: fix prop-descriptor request size Date: Thu, 9 May 2019 20:42:35 +0200 Message-Id: <20190509181251.309889371@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190509181250.417203112@linuxfoundation.org> References: <20190509181250.417203112@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit 47830c1127ef166af787caf2f871f23089610a7f upstream. 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/power_supply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/greybus/power_supply.c +++ b/drivers/staging/greybus/power_supply.c @@ -520,7 +520,7 @@ static int gb_power_supply_prop_descript 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)