ACK: [bionic/linux-azure][PATCH] UBUNTU: SAUCE: vmbus: don't return values for uninitalized channels
Colin Ian King
colin.king at canonical.com
Fri Aug 31 12:57:01 UTC 2018
On 31/08/18 13:52, Marcelo Henrique Cerri wrote:
> From: Stephen Hemminger <stephen at networkplumber.org>
>
> BugLink: http://bugs.launchpad.net/bugs/1789638
>
> For unsupported device types, the vmbus channel ringbuffer is never
> initialized, and therefore reading the sysfs files will return garbage
> or cause a kernel OOPS.
>
> Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info")
>
> Signed-off-by: Stephen Hemminger <sthemmin at microsoft.com>
> Signed-off-by: K. Y. Srinivasan <kys at microsoft.com>
> Cc: <stable at vger.kernel.org> # 4.15
> Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri at canonical.com>
> ---
> drivers/hv/vmbus_drv.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index 610223f0e945..4652990f0298 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -1180,6 +1180,9 @@ static ssize_t vmbus_chan_attr_show(struct kobject *kobj,
> if (!attribute->show)
> return -EIO;
>
> + if (chan->state != CHANNEL_OPENED_STATE)
> + return -EINVAL;
> +
> return attribute->show(chan, buf);
> }
>
>
Just wondering, should this be in all bionic kernels too?
I debugged the original issue so I understand the bug well enough to
confirm this is a good fix + it passes the tests and fixes the issue.
Acked-by: Colin Ian King <colin.king at canonical.com>
More information about the kernel-team
mailing list