]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
staging: greybus: power_supply: fix prop-descriptor request size
authorJohan Hovold <johan@kernel.org>
Thu, 4 Apr 2019 06:53:30 +0000 (08:53 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit027a4d456b25ad2e6d295ef4727c0d56d19ada29
treea3affa418068322e2933b1fbf300040b0e759987
parent644c6956561afff45958c5febb2be951e8deb600
staging: greybus: power_supply: fix prop-descriptor request size

BugLink: https://bugs.launchpad.net/bugs/1838459
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 <stable@vger.kernel.org> # 4.9
Cc: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/staging/greybus/power_supply.c