Linux virtualization list
 help / color / mirror / Atom feed
* Re: [PATCH net] vsock: prevent unnecessary refcnt inc for nonblocking connect
       [not found] <20211107120304.38224-1-eiichi.tsukata@nutanix.com>
@ 2021-11-08  8:30 ` Stefano Garzarella
  0 siblings, 0 replies; only message in thread
From: Stefano Garzarella @ 2021-11-08  8:30 UTC (permalink / raw)
  To: Eiichi Tsukata; +Cc: kuba, netdev, davem, linux-kernel, virtualization

On Sun, Nov 07, 2021 at 12:03:04PM +0000, Eiichi Tsukata wrote:
>Currently vosck_connect() increments sock refcount for nonblocking
>socket each time it's called, which can lead to memory leak if
>it's called multiple times because connect timeout function decrements
>sock refcount only once.
>
>Fixes it by making vsock_connect() return -EALREADY immediately when
>sock state is already SS_CONNECTING.
>
>Signed-off-by: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
>---
> net/vmw_vsock/af_vsock.c | 2 ++
> 1 file changed, 2 insertions(+)

Make sense to me, thanks for fixing this issue!
I think would be better to add the Fixes ref in the commit message:

Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")

With that:
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

Thanks,
Stefano

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-08  8:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20211107120304.38224-1-eiichi.tsukata@nutanix.com>
2021-11-08  8:30 ` [PATCH net] vsock: prevent unnecessary refcnt inc for nonblocking connect Stefano Garzarella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox