]> git.itanic.dy.fi Git - linux-stable/commit
m68k: Disable/restore interrupts in hwreg_present()/hwreg_write()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Sun, 28 Sep 2014 08:50:06 +0000 (10:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Oct 2014 16:43:09 +0000 (09:43 -0700)
commit14f90acbe84dbde1b5eff8295ff85a873d8663a4
tree6b775aaa09fd00591ae99d1d5cb118d377d7acf3
parent2ef3e6b09bdf3a2a1f2c597038f434d3f26bcf99
m68k: Disable/restore interrupts in hwreg_present()/hwreg_write()

commit e4dc601bf99ccd1c95b7e6eef1d3cf3c4b0d4961 upstream.

hwreg_present() and hwreg_write() temporarily change the VBR register to
another vector table. This table contains a valid bus error handler
only, all other entries point to arbitrary addresses.

If an interrupt comes in while the temporary table is active, the
processor will start executing at such an arbitrary address, and the
kernel will crash.

While most callers run early, before interrupts are enabled, or
explicitly disable interrupts, Finn Thain pointed out that macsonic has
one callsite that doesn't, causing intermittent boot crashes.
There's another unsafe callsite in hilkbd.

Fix this for good by disabling and restoring interrupts inside
hwreg_present() and hwreg_write().

Explicitly disabling interrupts can be removed from the callsites later.

Reported-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/m68k/mm/hwtest.c