From: FUJITA Tomonori <tomof@acm.org>
To: Anton.Kovalenko@acronis.com
Cc: stgt@vger.kernel.org
Subject: Re: [PATCH] use-after-free while iterating session->conn_list (two places)
Date: Wed, 10 May 2017 10:34:55 +0900 (JST) [thread overview]
Message-ID: <20170510.103455.1306558653114725733.tomof@acm.org> (raw)
In-Reply-To: <1493829345850.48512@acronis.com>
On Wed, 3 May 2017 16:35:45 +0000
Anton Kovalenko <Anton.Kovalenko@acronis.com> wrote:
> The problem (accessing session->conn_list after freeing session) was discovered using valgrind.
>
> Note that while list_for_each_entry_safe is safe against current list element destruction,
> it is UNSAFE against the traversed list_head (third argument) becoming invalid during iteration.
> That's exactly what happens when the last connection of a session goes away (conn_exit -> session_put -> use-after-free).
Great catch, applied both. Any other places like this?
Thanks a lot!
prev parent reply other threads:[~2017-05-10 1:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-03 16:35 [PATCH] use-after-free while iterating session->conn_list (two places) Anton Kovalenko
2017-05-10 1:34 ` FUJITA Tomonori [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=20170510.103455.1306558653114725733.tomof@acm.org \
--to=tomof@acm.org \
--cc=Anton.Kovalenko@acronis.com \
--cc=stgt@vger.kernel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).