From: Tejun Heo <tj@kernel.org>
To: Dave Jones <davej@codemonkey.org.uk>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>, cgroups@vger.kernel.org
Subject: Re: pids_free double free.
Date: Fri, 20 Nov 2015 15:48:13 -0500 [thread overview]
Message-ID: <20151120204813.GB1574@mtj.duckdns.org> (raw)
In-Reply-To: <20151120041836.GA18390@codemonkey.org.uk>
Hello, Dave.
On Thu, Nov 19, 2015 at 11:18:36PM -0500, Dave Jones wrote:
> One of my debian boxes got a systemd update. After rebooting,
> I started seeing a use-after-free trace, followed by a lockup.
>
> I have two slightly different traces from separate boots,
> which may give some clue as to how it's getting free'd in two ways..
>
> http://codemonkey.org.uk/junk/IMG_0474.jpg
> http://codemonkey.org.uk/junk/IMG_0476.jpg
>
> This isn't new, I booted back to 4.3, and hit slab debugging warnings
> from the same code. (At the least it was broken differently)
>
> The WARN_ON referenced in the 2nd trace is this..
>
> static void pids_cancel(struct pids_cgroup *pids, int num)
> {
> /*
> * A negative count (or overflow for that matter) is invalid,
> * and indicates a bug in the `pids` controller proper.
> */
> WARN_ON_ONCE(atomic64_add_negative(-num, &pids->counter));
> }
I *think* I know what's going on. Zombies don't pin the css so if the
cgroup gets removed, the free path may end up operating on a css which
has already been freed. Will look more into it.
Thanks.
--
tejun
prev parent reply other threads:[~2015-11-20 20:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-20 4:18 Dave Jones
2015-11-20 20:48 ` Tejun Heo [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=20151120204813.GB1574@mtj.duckdns.org \
--to=tj@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=davej@codemonkey.org.uk \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®