Skip to content
Commit 8b8f79b9 authored by Marcin Slusarz's avatar Marcin Slusarz Committed by Ingo Molnar
Browse files

x86, kmmio/mmiotrace: Fix double free of kmmio_fault_pages



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: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Tested-by: default avatarMarcin Kocielnicki <koriakin@0x04.net>
Tested-by: default avatarShinpei KATO <shinpei@il.is.s.u-tokyo.ac.jp>
Acked-by: default avatarPekka Paalanen <pq@iki.fi>
Cc: Stuart Bennett <stuart@freedesktop.org>
Cc: Marcin Kocielnicki <koriakin@0x04.net>
Cc: nouveau@lists.freedesktop.org
Cc: <stable@kernel.org>
LKML-Reference: <20100613215654.GA3829@joi.lan>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 7e27d6e7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment