[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210413154221.GA2369@anparri>
Date: Tue, 13 Apr 2021 17:42:21 +0200
From: Andrea Parri <parri.andrea@...il.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: "K. Y. Srinivasan" <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Dexuan Cui <decui@...rosoft.com>, linux-hyperv@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] Drivers: hv: vmbus: Use after free in __vmbus_open()
On Tue, Apr 13, 2021 at 01:50:04PM +0300, Dan Carpenter wrote:
> The "open_info" variable is added to the &vmbus_connection.chn_msg_list,
> but the error handling frees "open_info" without removing it from the
> list. This will result in a use after free. First remove it from the
> list, and then free it.
>
> Fixes: 6f3d791f3006 ("Drivers: hv: vmbus: Fix rescind handling issues")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
I had this 'queued' in my list,
Reviewed-by: Andrea Parri <parri.andrea@...il.com>
Andrea
> ---
> From static analysis. Untested etc. There is almost certainly a good
> reason to add it to the list before checking "newchannel->rescind" but I
> don't know the code well enough to know what the reason is.
>
> drivers/hv/channel.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
> index db30be8f9cce..1c5a418c1962 100644
> --- a/drivers/hv/channel.c
> +++ b/drivers/hv/channel.c
> @@ -653,7 +653,7 @@ static int __vmbus_open(struct vmbus_channel *newchannel,
>
> if (newchannel->rescind) {
> err = -ENODEV;
> - goto error_free_info;
> + goto error_clean_msglist;
> }
>
> err = vmbus_post_msg(open_msg,
> --
> 2.30.2
>
Powered by blists - more mailing lists