]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Drivers: hv: vmbus: Check for ring when getting debug info
authorDexuan Cui <decui@microsoft.com>
Mon, 17 Dec 2018 20:16:09 +0000 (20:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Jan 2019 07:14:36 +0000 (08:14 +0100)
commita912e16faeda0f047aa334d062b70f20126f48bc
tree786a88e9de43a661835294d7c20ad768ac3cbe5b
parentbfe482b9b299d4a79c76d6c7879b1faee85111b1
Drivers: hv: vmbus: Check for ring when getting debug info

commit ba50bf1ce9a51fc97db58b96d01306aa70bc3979 upstream.

fc96df16a1ce is good and can already fix the "return stack garbage" issue,
but let's also improve hv_ringbuffer_get_debuginfo(), which would silently
return stack garbage, if people forget to check channel->state or
ring_info->ring_buffer, when using the function in the future.

Having an error check in the function would eliminate the potential risk.

Add a Fixes tag to indicate the patch depdendency.

Fixes: fc96df16a1ce ("Drivers: hv: vmbus: Return -EINVAL for the sys files for unopened channels")
Cc: stable@vger.kernel.org
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/ring_buffer.c
drivers/hv/vmbus_drv.c
include/linux/hyperv.h