mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: shangxiaojing <shangxiaojing@huawei.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: <acme@redhat.com>, <linux-kernel@vger.kernel.org>, <namhyung@kernel.org>
Subject: Re: [PATCH] tools lib traceevent: Fix double free in event_read_fields()
Date: Fri, 21 Oct 2022 09:01:26 +0800	[thread overview]
Message-ID: <07232902-0e64-fab5-c60c-570e7004d6c9@huawei.com> (raw)
In-Reply-To: <20221020172324.66c6927f@gandalf.local.home>



On 2022/10/21 5:23, Steven Rostedt wrote:
> On Mon, 17 Oct 2022 16:59:37 +0800
> Shang XiaoJing <shangxiaojing@huawei.com> wrote:
> 
>> There is a double free in event_read_fields(). After calling free_token()
>> to free the token, if append() failed, then goto fail, which will call
>> free_token() again. Triggered by compiling with perf and run "perf sched
>> record". Fix the double free by goto fail_expect instead of fail while
>> append() failed, which won't call redundant free_token().
>>
>> BUG: double free
>> free(): double free detected in tcache 2
>> Aborted
>>
>> Fixes: d286447f23cd ("tools lib traceevent: Handle realloc() failure path")
>> Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
>> ---
>>   tools/lib/traceevent/event-parse.c | 2 +-
> 
> tool/lib/traceevent is deprecated.
> 
> Can you send this patch to linux-trace-devel@vger.kernel.org against
> 
>    https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
> 
ok, thanks for the reminder.

Thanks,
-- 
Shang XiaoJing

      reply	other threads:[~2022-10-21  1:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17  8:59 Shang XiaoJing
2022-10-20 21:23 ` Steven Rostedt
2022-10-21  1:01   ` shangxiaojing [this message]

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=07232902-0e64-fab5-c60c-570e7004d6c9@huawei.com \
    --to=shangxiaojing@huawei.com \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.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

all inboxes | Powered by JetHome®