linux/arch/sparc/mm
David S. Miller eeabac7386 sparc64: Validate kernel generated fault addresses on sparc64.
In order to handle all of the cases of address calculation overflow
properly, we run sparc 32-bit processes in "address masking" mode
when running on a 64-bit kernel.

Address masking mode zeros out the top 32-bits of the address
calculated for every load and store instruction.

However, when we're in privileged mode we have to run with that
address masking mode disabled even when accessing userspace from
the kernel.

To "simulate" the address masking mode we clear the top-bits by
hand for 32-bit processes in the fault handler.

It is the responsibility of code in the compat layer to properly
zero extend addresses used to access userspace.  If this isn't
followed properly we can get into a fault loop.

Say that the user address is 0xf0000000 but for whatever reason
the kernel code sign extends this to 64-bit, and then the kernel
tries to access the result.

In such a case we'll fault on address 0xfffffffff0000000 but the fault
handler will process that fault as if it were to address 0xf0000000.
We'll loop faulting forever because the fault never gets satisfied.

So add a check specifically for this case, when the kernel is faulting
on a user address access and the addresses don't match up.

This code path is sufficiently slow path, and this bug is sufficiently
painful to diagnose, that this kind of bug check is warranted.

Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-02 22:08:15 -08:00
..
Makefile sparc,sparc64: unify mm/ 2008-12-04 09:16:59 -08:00
btfixup.c sparc: remove CONFIG_SUN4 2008-08-31 20:59:37 -07:00
extable.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
fault_32.c sparc: refactor code in fault_32.c 2009-01-06 12:52:41 -08:00
fault_64.c sparc64: Validate kernel generated fault addresses on sparc64. 2009-02-02 22:08:15 -08:00
generic_32.c sparc: move EXPORT_SYMBOL to the symbols definition 2009-01-08 16:58:05 -08:00
generic_64.c sparc64: move EXPORT_SYMBOL to the symbols definition 2009-01-08 16:58:20 -08:00
highmem.c sparc: move EXPORT_SYMBOL to the symbols definition 2009-01-08 16:58:05 -08:00
hugetlbpage.c sparc,sparc64: unify mm/ 2008-12-04 09:16:59 -08:00
hypersparc.S sparc: remove CVS keywords 2008-05-20 00:33:44 -07:00
init_32.c sparc: move EXPORT_SYMBOL to the symbols definition 2009-01-08 16:58:05 -08:00
init_64.c sparc64: move EXPORT_SYMBOL to the symbols definition 2009-01-08 16:58:20 -08:00
init_64.h sparc,sparc64: unify mm/ 2008-12-04 09:16:59 -08:00
io-unit.c sparc: use sparc64 version of scatterlist.h 2008-12-11 20:24:58 -08:00
iommu.c sparc: use sparc64 version of scatterlist.h 2008-12-11 20:24:58 -08:00
loadmmu.c sparc: remove CVS keywords 2008-05-20 00:33:44 -07:00
nosun4c.c sparc: remove CVS keywords 2008-05-20 00:33:44 -07:00
srmmu.c sparc: drop SUN_IO 2008-12-27 00:55:45 -08:00
sun4c.c sparc: unify sections.h 2008-12-27 00:35:12 -08:00
swift.S sparc: remove CVS keywords 2008-05-20 00:33:44 -07:00
tlb.c sparc,sparc64: unify mm/ 2008-12-04 09:16:59 -08:00
tsb.c sparc64: Add tsb-ratio sysctl. 2008-12-04 09:16:59 -08:00
tsunami.S sparc/mm/: possible cleanups 2008-07-17 21:38:01 -07:00
ultra.S sparc64: Make %pil level 15 a pseudo-NMI. 2008-12-04 09:17:02 -08:00
viking.S sparc: remove CVS keywords 2008-05-20 00:33:44 -07:00