From: zhanghailiang <zhang.zhanghailiang@huawei.com>
To: Paolo Bonzini <pbonzini@redhat.com>, <qemu-trivial@nongnu.org>
Cc: qemu-devel@nongnu.org, stefanha@redhat.com, peter.huangpeng@huawei.com
Subject: Re: [Qemu-trivial] [PATCH] l2tpv3: fix possible double free
Date: Mon, 17 Nov 2014 13:13:23 +0800 [thread overview]
Message-ID: <546983F3.9010707@huawei.com> (raw)
In-Reply-To: <5465C130.1090401@redhat.com>
On 2014/11/14 16:45, Paolo Bonzini wrote:
>
>
> On 14/11/2014 02:39, zhanghailiang wrote:
>> freeaddrinfo(result) does not assign result = NULL, after frees it.
>> There will be a double free when it goes error case.
>> It is reported by covertiy.
>>
>> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
>> ---
>> net/l2tpv3.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/net/l2tpv3.c b/net/l2tpv3.c
>> index 528d95b..f9e0c98 100644
>> --- a/net/l2tpv3.c
>> +++ b/net/l2tpv3.c
>> @@ -661,6 +661,7 @@ int net_init_l2tpv3(const NetClientOptions *opts,
>> fd = -errno;
>> error_report("l2tpv3_open : socket creation failed, errno = %d", -fd);
>> freeaddrinfo(result);
>> + result = NULL;
>
> You can just remove the call to freeaddrinfo(). I made the change and
> applied the patch.
>
This is a better choice ;) Thanks.
>> goto outerr;
>> }
>> if (bind(fd, (struct sockaddr *) result->ai_addr, result->ai_addrlen)) {
>>
>
>
WARNING: multiple messages have this Message-ID (diff)
From: zhanghailiang <zhang.zhanghailiang@huawei.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-trivial@nongnu.org
Cc: qemu-devel@nongnu.org, stefanha@redhat.com, peter.huangpeng@huawei.com
Subject: Re: [Qemu-devel] [PATCH] l2tpv3: fix possible double free
Date: Mon, 17 Nov 2014 13:13:23 +0800 [thread overview]
Message-ID: <546983F3.9010707@huawei.com> (raw)
In-Reply-To: <5465C130.1090401@redhat.com>
On 2014/11/14 16:45, Paolo Bonzini wrote:
>
>
> On 14/11/2014 02:39, zhanghailiang wrote:
>> freeaddrinfo(result) does not assign result = NULL, after frees it.
>> There will be a double free when it goes error case.
>> It is reported by covertiy.
>>
>> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
>> ---
>> net/l2tpv3.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/net/l2tpv3.c b/net/l2tpv3.c
>> index 528d95b..f9e0c98 100644
>> --- a/net/l2tpv3.c
>> +++ b/net/l2tpv3.c
>> @@ -661,6 +661,7 @@ int net_init_l2tpv3(const NetClientOptions *opts,
>> fd = -errno;
>> error_report("l2tpv3_open : socket creation failed, errno = %d", -fd);
>> freeaddrinfo(result);
>> + result = NULL;
>
> You can just remove the call to freeaddrinfo(). I made the change and
> applied the patch.
>
This is a better choice ;) Thanks.
>> goto outerr;
>> }
>> if (bind(fd, (struct sockaddr *) result->ai_addr, result->ai_addrlen)) {
>>
>
>
next prev parent reply other threads:[~2014-11-17 5:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-14 1:39 [Qemu-trivial] [PATCH] l2tpv3: fix possible double free zhanghailiang
2014-11-14 1:39 ` [Qemu-devel] " zhanghailiang
2014-11-14 3:03 ` [Qemu-trivial] " Gonglei
2014-11-14 3:03 ` Gonglei
2014-11-14 8:45 ` [Qemu-trivial] " Paolo Bonzini
2014-11-14 8:45 ` [Qemu-devel] " Paolo Bonzini
2014-11-17 5:13 ` zhanghailiang [this message]
2014-11-17 5:13 ` zhanghailiang
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=546983F3.9010707@huawei.com \
--to=zhang.zhanghailiang@huawei.com \
--cc=pbonzini@redhat.com \
--cc=peter.huangpeng@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=stefanha@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.