From: Marcin Slusarz <marcin.slusarz@gmail.com>
To: x86@kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>, "Pekka Paalanen" <pq@iki.fi>,
"Stuart Bennett" <stuart@freedesktop.org>,
"Marcin Kościelnicki" <koriakin@0x04.net>,
"Shinpei KATO" <shinpei@il.is.s.u-tokyo.ac.jp>,
nouveau@lists.freedesktop.org, "Ingo Molnar" <mingo@elte.hu>
Subject: Re: [PATCHv2] kmmio/mmiotrace: fix double free of kmmio_fault_pages
Date: Mon, 14 Jun 2010 00:18:03 +0200 [thread overview]
Message-ID: <20100613221803.GB3829@joi.lan> (raw)
In-Reply-To: <20100613215654.GA3829@joi.lan>
On Sun, Jun 13, 2010 at 11:56:54PM +0200, Marcin Slusarz wrote:
> After every iounmap mmiotrace has to free kmmio_fault_pages, but it
> can't do it directly, so it defers freeing by RCU.
>
> It usually works, but when mmiotraced code calls ioremap-iounmap
> multiple times without sleeping between (so RCU won't kick in and
> start freeing) it can be given the same virtual address, so at
> every iounmap mmiotrace will schedule the same pages for release.
> Obviously it will explode on second free.
>
> Fix it by marking kmmio_fault_pages which are scheduled for release
> and not adding them second time.
>
> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
> Acked-by: Pekka Paalanen <pq@iki.fi>
> Cc: Stuart Bennett <stuart@freedesktop.org>
> Tested-by: Marcin Kościelnicki <koriakin@0x04.net>
> Tested-by: Shinpei KATO <shinpei@il.is.s.u-tokyo.ac.jp>
> ---
It would be good to apply it to -stable too. Sometimes people has to test
some earlier kernels because of unfixable constraints (you know, these
uncooperative vendors not releasing their binary drivers for latest kernels)
Marcin
next prev parent reply other threads:[~2010-06-13 22:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-13 21:56 [PATCHv2] kmmio/mmiotrace: fix double free of kmmio_fault_pages Marcin Slusarz
2010-06-13 22:18 ` Marcin Slusarz [this message]
2010-06-18 10:21 ` [tip:x86/mm] x86, kmmio/mmiotrace: Fix " tip-bot for Marcin Slusarz
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=20100613221803.GB3829@joi.lan \
--to=marcin.slusarz@gmail.com \
--cc=koriakin@0x04.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nouveau@lists.freedesktop.org \
--cc=pq@iki.fi \
--cc=shinpei@il.is.s.u-tokyo.ac.jp \
--cc=stuart@freedesktop.org \
--cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.