From: "Michael S. Tsirkin" <mst@redhat•com>
To: Hyunwoo Kim <v4bel@theori•io>
Cc: "K. Y. Srinivasan" <kys@microsoft•com>,
Haiyang Zhang <haiyangz@microsoft•com>,
Wei Liu <wei.liu@kernel•org>, Dexuan Cui <decui@microsoft•com>,
Stefano Garzarella <sgarzare@redhat•com>,
jasowang@redhat•com, "David S. Miller" <davem@davemloft•net>,
Eric Dumazet <edumazet@google•com>,
Jakub Kicinski <kuba@kernel•org>, Paolo Abeni <pabeni@redhat•com>,
Simon Horman <horms@kernel•org>,
linux-hyperv@vger•kernel.org, virtualization@lists•linux.dev,
netdev@vger•kernel.org, gregkh@linuxfoundation•org,
imv4bel@gmail•com
Subject: Re: [PATCH v2] hv_sock: Initializing vsk->trans to NULL to prevent a dangling pointer
Date: Wed, 6 Nov 2024 04:42:04 -0500 [thread overview]
Message-ID: <20241106044145-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <Zys4hCj61V+mQfX2@v4bel-B760M-AORUS-ELITE-AX>
On Wed, Nov 06, 2024 at 04:36:04AM -0500, Hyunwoo Kim wrote:
> When hvs is released, there is a possibility that vsk->trans may not
> be initialized to NULL, which could lead to a dangling pointer.
> This issue is resolved by initializing vsk->trans to NULL.
>
> Fixes: ae0078fcf0a5 ("hv_sock: implements Hyper-V transport for Virtual Sockets (AF_VSOCK)")
> Cc: stable@vger•kernel.org
> Signed-off-by: Hyunwoo Kim <v4bel@theori•io>
Acked-by: Michael S. Tsirkin <mst@redhat•com>
> ---
> v1 -> v2: Add fixes and cc tags
> ---
> net/vmw_vsock/hyperv_transport.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
> index e2157e387217..56c232cf5b0f 100644
> --- a/net/vmw_vsock/hyperv_transport.c
> +++ b/net/vmw_vsock/hyperv_transport.c
> @@ -549,6 +549,7 @@ static void hvs_destruct(struct vsock_sock *vsk)
> vmbus_hvsock_device_unregister(chan);
>
> kfree(hvs);
> + vsk->trans = NULL;
> }
>
> static int hvs_dgram_bind(struct vsock_sock *vsk, struct sockaddr_vm *addr)
> --
> 2.34.1
next prev parent reply other threads:[~2024-11-06 9:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 9:36 [PATCH v2] hv_sock: Initializing vsk->trans to NULL to prevent a dangling pointer Hyunwoo Kim
2024-11-06 9:41 ` Stefano Garzarella
2024-11-06 9:42 ` Michael S. Tsirkin [this message]
2024-11-07 19:29 ` Jakub Kicinski
2024-11-07 21:41 ` Michael S. Tsirkin
2024-11-07 21:52 ` Jakub Kicinski
2024-11-08 9:06 ` Hyunwoo Kim
2024-11-09 17:50 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241106044145-mutt-send-email-mst@kernel.org \
--to=mst@redhat$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=decui@microsoft$(echo .)com \
--cc=edumazet@google$(echo .)com \
--cc=gregkh@linuxfoundation$(echo .)org \
--cc=haiyangz@microsoft$(echo .)com \
--cc=horms@kernel$(echo .)org \
--cc=imv4bel@gmail$(echo .)com \
--cc=jasowang@redhat$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=kys@microsoft$(echo .)com \
--cc=linux-hyperv@vger$(echo .)kernel.org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=sgarzare@redhat$(echo .)com \
--cc=v4bel@theori$(echo .)io \
--cc=virtualization@lists$(echo .)linux.dev \
--cc=wei.liu@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox