Thread (5 messages) 5 messages, 2 authors, 2012-07-26

[PATCH 1/2] ARM: mm: avoid setting nG bit for user mappings that aren't present

flat view
STALE5190d REVIEWED: 3 (3M)

From: catalin.marinas@arm.com (Catalin Marinas)
Date: 2012-07-26 16:49:08

1 review trailer.

On Thu, Jul 26, 2012 at 05:01:07PM +0100, Will Deacon wrote:
Swap entries are encoding in ptes such that !pte_present(pte) and
pte_file(pte). The remaining bits of the descriptor are used to identify
the swapfile and offset within it to the swap entry.

When writing such a pte for a user virtual address, set_pte_at
unconditionally sets the nG bit, which (in the case of LPAE) will
corrupt the swapfile offset and lead to a BUG:

[  140.494067] swap_free: Unused swap offset entry 000763b4
[  140.509989] BUG: Bad page map in process rs:main Q:Reg  pte:0ec76800 pmd:8f92e003

This patch fixes the problem by only setting the nG bit for user
mappings that are actually present.

Signed-off-by: Will Deacon <redacted>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help