From: David Marchand <david.marchand@redhat.com>
To: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: dev <dev@dpdk.org>, Xueqin Lin <xueqin.lin@intel.com>,
Vladimir Medvedkin <vladimir.medvedkin@intel.com>,
dpdk stable <stable@dpdk.org>
Subject: Re: [PATCH v2 1/1] malloc: fix ASan handling for unmapped memory
Date: Thu, 5 May 2022 11:10:42 +0200 [thread overview]
Message-ID: <CAJFAV8xUA_pCHwT_yvKb4KJTuGsE-fdERJLfckXdQ2o5YgnkMQ@mail.gmail.com> (raw)
In-Reply-To: <54f5fe8c3e8ba5412dc34bace1409c44efd6035a.1651674707.git.anatoly.burakov@intel.com>
On Wed, May 4, 2022 at 4:32 PM Anatoly Burakov
<anatoly.burakov@intel.com> wrote:
>
> Currently, when we free previously allocated memory, we mark the area as
> "freed" for ASan purposes (flag 0xfd). However, sometimes, freeing a
> malloc element will cause pages to be unmapped from memory and re-backed
> with anonymous memory again. This may cause ASan's "use-after-free"
> error down the line, because the allocator will try to write into
> memory areas recently marked as "freed".
>
> To fix this, we need to mark the unmapped memory area as "available",
> and fixup surrounding malloc element header/trailers to enable later
> malloc routines to safely write into new malloc elements' headers or
> trailers.
Bugzilla ID: 994
> Fixes: 6cc51b1293ce ("mem: instrument allocator for ASan")
> Cc: stable@dpdk.org
>
Reported-by: David Marchand <david.marchand@redhat.com>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
It fixes the issues I saw with unit tests.
Applied, thanks for working on this problem.
I'll respin my series that enables ASan in GHA.
--
David marchand
prev parent reply other threads:[~2022-05-05 9:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-04 13:40 [PATCH v1 " Anatoly Burakov
2022-05-04 14:31 ` [PATCH v2 " Anatoly Burakov
2022-05-05 9:10 ` David Marchand [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=CAJFAV8xUA_pCHwT_yvKb4KJTuGsE-fdERJLfckXdQ2o5YgnkMQ@mail.gmail.com \
--to=david.marchand@redhat.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
--cc=vladimir.medvedkin@intel.com \
--cc=xueqin.lin@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).