]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Nov 2015 22:37:31 +0000 (14:37 -0800)
commite57ed4a9ec1fd07524a54c2d70d474a2ac7dd642
treee1120e91350a47cbf5b2eeaab8a8294ba58ab3f4
parent0ffd54b0691964badb30740cb959c0d18f9df2b4
iommu/amd: Fix BUG when faulting a PROT_NONE VMA

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>
drivers/iommu/amd_iommu_v2.c