Please sign in to comment.
mm/filemap_xip.c: fix race condition in xip_file_fault()
commit 99f02ef upstream. Fix a race condition that shows in conjunction with xip_file_fault() when two threads of the same user process fault on the same memory page. In this case, the race winner will install the page table entry and the unlucky loser will cause an oops: xip_file_fault calls vm_insert_pfn (via vm_insert_mixed) which drops out at this check: retval = -EBUSY; if (!pte_none(*pte)) goto out_unlock; The resulting -EBUSY return value will trigger a BUG_ON() in xip_file_fault. This fix simply considers the fault as fixed in this case, because the race winner has successfully installed the pte. [email@example.com: use conventional (and consistent) comment layout] Reported-by: David Sadler <firstname.lastname@example.org> Signed-off-by: Carsten Otte <email@example.com> Reported-by: Louis Alex Eisner <firstname.lastname@example.org> Cc: Hugh Dickins <email@example.com> Signed-off-by: Andrew Morton <firstname.lastname@example.org> Signed-off-by: Linus Torvalds <email@example.com> Signed-off-by: Greg Kroah-Hartman <firstname.lastname@example.org>
- Loading branch information...