android_kernel_samsung_univ.../arch
Paul Mackerras 2c6ae28f81 powerpc/mm: Don't alias user region to other regions below PAGE_OFFSET
commit f077aaf0754bcba0fffdbd925bc12f09cd1e38aa upstream.

In commit c60ac5693c ("powerpc: Update kernel VSID range", 2013-03-13)
we lost a check on the region number (the top four bits of the effective
address) for addresses below PAGE_OFFSET.  That commit replaced a check
that the top 18 bits were all zero with a check that bits 46 - 59 were
zero (performed for all addresses, not just user addresses).

This means that userspace can access an address like 0x1000_0xxx_xxxx_xxxx
and we will insert a valid SLB entry for it.  The VSID used will be the
same as if the top 4 bits were 0, but the page size will be some random
value obtained by indexing beyond the end of the mm_ctx_high_slices_psize
array in the paca.  If that page size is the same as would be used for
region 0, then userspace just has an alias of the region 0 space.  If the
page size is different, then no HPTE will be found for the access, and
the process will get a SIGSEGV (since hash_page_mm() will refuse to create
a HPTE for the bogus address).

The access beyond the end of the mm_ctx_high_slices_psize can be at most
5.5MB past the array, and so will be in RAM somewhere.  Since the access
is a load performed in real mode, it won't fault or crash the kernel.
At most this bug could perhaps leak a little bit of information about
blocks of 32 bytes of memory located at offsets of i * 512kB past the
paca->mm_ctx_high_slices_psize array, for 1 <= i <= 11.

Fixes: c60ac5693c ("powerpc: Update kernel VSID range")
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-24 10:07:35 +02:00
..
alpha
arc ARC: Elide redundant setup of DMA callbacks 2016-09-07 08:32:42 +02:00
arm ARM: dts: sunxi: Add a startup delay for fixed regulator enabled phys 2016-08-20 18:09:22 +02:00
arm64 irqchip/gicv3-its: numa: Enable workaround for Cavium thunderx erratum 23144 2016-09-15 08:27:47 +02:00
avr32
blackfin
c6x
cris
frv
h8300
hexagon
ia64
m32r
m68k
metag metag: Fix atomic_*_return inline asm constraints 2016-09-15 08:27:54 +02:00
microblaze
mips MIPS: KVM: Check for pfn noslot case 2016-09-24 10:07:35 +02:00
mn10300
nios2
openrisc
parisc parisc: Fix order of EREFUSED define in errno.h 2016-09-07 08:32:36 +02:00
powerpc powerpc/mm: Don't alias user region to other regions below PAGE_OFFSET 2016-09-24 10:07:35 +02:00
s390 s390/crypto: provide correct file mode at device register. 2016-09-15 08:27:46 +02:00
score
sh
sparc
tile
um um: Don't discard .text.exit section 2016-09-07 08:32:38 +02:00
unicore32
x86 Revert "KVM: x86: fix missed hardware breakpoints" 2016-09-24 10:07:35 +02:00
xtensa
.gitignore
Kconfig