]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommu/amd: Fix BUG when faulting a PROT_NONE VMA
authorJay Cornwall <jay@jcornwall.me>
Wed, 16 Sep 2015 19:10:03 +0000 (14:10 -0500)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 5 Feb 2016 03:28:15 +0000 (19:28 -0800)
commit48c388e28ae1773d5fe26c98f02ec429c69ba7a8
tree4c8f0f0c84d47f7d130f669fb4baee8e452409f9
parent4ebe842a7e30ceaed3a6ecb352d3b860e3109d6c
iommu/amd: Fix BUG when faulting a PROT_NONE VMA

Orabug: 22623806

commit d14f6fced5f9360edca5a1325ddb7077aab1203b upstream.

handle_mm_fault indirectly triggers a BUG in do_numa_page
when given a VMA without read/write/execute access. Check
this condition in do_fault.

do_fault -> handle_mm_fault -> handle_pte_fault -> do_numa_page

  mm/memory.c
  3147  static int do_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
  ....
  3159  /* A PROT_NONE fault should not end up here */
  3160  BUG_ON(!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)));

Signed-off-by: Jay Cornwall <jay@jcornwall.me>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 75deee3f94d33c9858bbc2e7d67f43eaca84f5dc)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/iommu/amd_iommu_v2.c