[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-mips-cvs
Subject: MIPS: vDSO: Fix Malta EVA mapping to vDSO page structs
From: linux-mips () linux-mips ! org
Date: 2016-09-22 9:03:01
Message-ID: S23992100AbcIVJDDgx0pA/20160922090303Z+2872 () eddie ! linux-mips ! org
[Download RAW message or body]
Author: James Hogan <james.hogan@imgtec.com> Wed Sep 7 13:37:01 2016 +0100
Comitter: Ralf Baechle <ralf@linux-mips.org> Wed Sep 21 15:55:55 2016 +0200
Commit: 767f5771e37f046596e9e5fe7e651f4c052dc8ae
Gitweb: https://git.linux-mips.org/g/ralf/linux/767f5771e37f
Branch: linux-4.4-stable
The page structures associated with the vDSO pages in the kernel image
are calculated using virt_to_page(), which uses __pa() under the hood to
find the pfn associated with the virtual address. The vDSO data pointers
however point to kernel symbols, so __pa_symbol() should really be used
instead.
Since there is no equivalent to virt_to_page() which uses __pa_symbol(),
fix init_vdso_image() to work directly with pfns, calculated with
__phys_to_pfn(__pa_symbol(...)).
This issue broke the Malta Enhanced Virtual Addressing (EVA)
configuration which has a non-default implementation of __pa_symbol().
This is because it uses a physical alias so that the kernel executes
from KSeg0 (VA 0x80000000 -> PA 0x00000000), while RAM is provided to
the kernel in the KUSeg range (VA 0x00000000 -> PA 0x80000000) which
uses the same underlying RAM.
Since there are no page structures associated with the low physical
address region, some arbitrary kernel memory would be interpreted as a
page structure for the vDSO pages and badness ensues.
Fixes: ebb5e78cc634 ("MIPS: Initial implementation of a VDSO")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Leonid Yegoshin <leonid.yegoshin@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org> # 4.4.x-
Patchwork: https://patchwork.linux-mips.org/patch/14229/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
(cherry picked from commit afacb3b1e97985265ba9d9e87da50cfa1009b674)
---
arch/mips/kernel/vdso.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic