lkml.org 
[lkml]   [2021]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH net] vsock: prevent unnecessary refcnt inc for nonblocking connect
Date


> On Nov 8, 2021, at 17:30, Stefano Garzarella <sgarzare@redhat.com> wrote:
>
> 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
>

Thanks for comments! I’ll add Fixes and Reviewed-by tag then send v2.

Eiichi
\
 
 \ /
  Last update: 2021-11-09 01:14    [W:0.062 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site