Netdev List
 help / color / mirror / Atom feed
From: Stefano Garzarella <sgarzare@redhat.com>
To: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
Cc: davem@davemloft.net, kuba@kernel.org,
	virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] vsock: prevent unnecessary refcnt inc for nonblocking connect
Date: Mon, 8 Nov 2021 09:30:13 +0100	[thread overview]
Message-ID: <20211108083013.svl77coopyryngfl@steredhat> (raw)
In-Reply-To: <20211107120304.38224-1-eiichi.tsukata@nutanix.com>

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


  reply	other threads:[~2021-11-08  8:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-07 12:03 [PATCH net] vsock: prevent unnecessary refcnt inc for nonblocking connect Eiichi Tsukata
2021-11-08  8:30 ` Stefano Garzarella [this message]
2021-11-09  0:13   ` Eiichi Tsukata

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=20211108083013.svl77coopyryngfl@steredhat \
    --to=sgarzare@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eiichi.tsukata@nutanix.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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