From: Pekka Enberg <penberg@kernel.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Christopher Li <sparse@chrisli.org>, Xi Wang <xi.wang@gmail.com>,
linux-sparse@vger.kernel.org
Subject: Re: [PATCH] compile-i386: fix use-after-free in func_cleanup()
Date: Mon, 4 Jun 2012 14:01:50 +0300 [thread overview]
Message-ID: <CAOJsxLE_QeiKpXqy=xz1E+Beg+MCu9yJf=LYMb_iTWn1UEcNRQ@mail.gmail.com> (raw)
In-Reply-To: <CAFtxgO7dwKEb8Fc153_jzBJira6uFrBYTd_1e4hF0q+yHc8aJw@mail.gmail.com>
On Mon, Jun 4, 2012 at 12:42 PM, Jeff Garzik <jgarzik@pobox.com> wrote:
> On Fri, Jun 1, 2012 at 9:55 PM, Christopher Li <sparse@chrisli.org> wrote:
>> On Fri, Jun 1, 2012 at 9:22 AM, Xi Wang <xi.wang@gmail.com> wrote:
>>> compile-i386 sometimes crashes due a use-after-free error. Since
>>> f->pseudo_list is freed first, which invalidates some atom->op* in
>>> f->atom_list. Further checks like `atom->op1->flags & STOR_WANTS_FREE'
>>> will read garbage, which may lead to a double free.
>>>
>>> This patch switches the cleanup order and frees f->atom_list first.
>>> Those marked as STOR_WANTS_FREE won't appear in f->pseudo_list.
>>
>> Seems make sense. I will apply if Jeff don't have any objections.
>
> If the patch makes sense, go for it. I'm on vacation in France until
> June 8, the original patch is not in my inbox, and I do not have
> readily available Internet connectivity besides... :)
Looks good to me.
Reviewed-by: Pekka Enberg <penberg@kernel.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2012-06-04 11:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-01 16:22 [PATCH] compile-i386: fix use-after-free in func_cleanup() Xi Wang
[not found] ` <CANeU7Qm9Lo320TmkMzh6BKVC4Uwz6Pz6btuNxmW3fJH7zMMYcg@mail.gmail.com>
2012-06-04 9:42 ` Jeff Garzik
2012-06-04 11:01 ` Pekka Enberg [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='CAOJsxLE_QeiKpXqy=xz1E+Beg+MCu9yJf=LYMb_iTWn1UEcNRQ@mail.gmail.com' \
--to=penberg@kernel.org \
--cc=jgarzik@pobox.com \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.org \
--cc=xi.wang@gmail.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).