]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ARC: fix page address calculation if PAGE_OFFSET != LINUX_LINK_BASE
authorAlexey Brodkin <abrodkin@synopsys.com>
Thu, 12 Feb 2015 18:10:11 +0000 (21:10 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Mar 2015 22:43:31 +0000 (14:43 -0800)
commit645177f349bf6b276bb55d7d9b492b964ff066bd
tree3b985ce83dbab2c9c4bcb9e001fbdeb5fca40178
parent5e2b0b3f502ec060479d3f266b2cf9ff40ce8d2a
ARC: fix page address calculation if PAGE_OFFSET != LINUX_LINK_BASE

commit 06f34e1c28f3608b0ce5b310e41102d3fe7b65a1 upstream.

We used to calculate page address differently in 2 cases:

1. In virt_to_page(x) we do
 --->8---
 mem_map + (x - CONFIG_LINUX_LINK_BASE) >> PAGE_SHIFT
 --->8---

2. In in pte_page(x) we do
 --->8---
 mem_map + (pte_val(x) - PAGE_OFFSET) >> PAGE_SHIFT
 --->8---

That leads to problems in case PAGE_OFFSET != CONFIG_LINUX_LINK_BASE -
different pages will be selected depending on where and how we calculate
page address.

In particular in the STAR 9000853582 when gdb attempted to read memory
of another process it got improper page in get_user_pages() because this
is exactly one of the places where we search for a page by pte_page().

The fix is trivial - we need to calculate page address similarly in both
cases.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arc/include/asm/pgtable.h