Files
android_kernel_xiaomi_sm8450/include/linux
Dan Williams fce86ff580 mm/huge_memory: fix vmf_insert_pfn_{pmd, pud}() crash, handle unaligned addresses
Starting with c6f3c5ee40 ("mm/huge_memory.c: fix modifying of page
protection by insert_pfn_pmd()") vmf_insert_pfn_pmd() internally calls
pmdp_set_access_flags().  That helper enforces a pmd aligned @address
argument via VM_BUG_ON() assertion.

Update the implementation to take a 'struct vm_fault' argument directly
and apply the address alignment fixup internally to fix crash signatures
like:

    kernel BUG at arch/x86/mm/pgtable.c:515!
    invalid opcode: 0000 [#1] SMP NOPTI
    CPU: 51 PID: 43713 Comm: java Tainted: G           OE     4.19.35 #1
    [..]
    RIP: 0010:pmdp_set_access_flags+0x48/0x50
    [..]
    Call Trace:
     vmf_insert_pfn_pmd+0x198/0x350
     dax_iomap_fault+0xe82/0x1190
     ext4_dax_huge_fault+0x103/0x1f0
     ? __switch_to_asm+0x40/0x70
     __handle_mm_fault+0x3f6/0x1370
     ? __switch_to_asm+0x34/0x70
     ? __switch_to_asm+0x40/0x70
     handle_mm_fault+0xda/0x200
     __do_page_fault+0x249/0x4f0
     do_page_fault+0x32/0x110
     ? page_fault+0x8/0x30
     page_fault+0x1e/0x30

Link: http://lkml.kernel.org/r/155741946350.372037.11148198430068238140.stgit@dwillia2-desk3.amr.corp.intel.com
Fixes: c6f3c5ee40 ("mm/huge_memory.c: fix modifying of page protection by insert_pfn_pmd()")
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Reported-by: Piotr Balcer <piotr.balcer@intel.com>
Tested-by: Yan Ma <yan.ma@intel.com>
Tested-by: Pankaj Gupta <pagupta@redhat.com>
Reviewed-by: Matthew Wilcox <willy@infradead.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Cc: Chandan Rajendra <chandan@linux.ibm.com>
Cc: Souptick Joarder <jrdr.linux@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-05-14 09:47:44 -07:00
..
2018-11-14 10:56:33 -08:00
2019-05-07 11:46:02 -07:00
2018-11-12 10:33:49 +01:00
2019-04-16 18:03:48 +02:00
2019-05-02 10:37:55 +09:00
2019-04-15 18:14:01 -04:00
2019-04-23 01:50:43 +02:00
2019-04-09 17:05:46 -07:00
2019-05-07 08:39:02 -06:00
2019-04-19 11:26:48 -07:00
2018-11-13 21:55:24 +01:00
2019-02-28 03:28:53 -05:00
2019-03-12 18:59:17 -07:00
2019-02-28 08:24:23 -07:00
2018-12-19 10:42:08 +01:00
2019-04-29 12:37:46 +02:00
2019-03-12 10:04:02 -07:00
2019-04-22 09:48:12 -06:00
2019-03-05 21:07:16 -08:00
2019-02-15 16:54:38 +01:00
2019-03-12 10:04:00 -07:00
2019-03-09 19:52:47 -08:00
2019-03-22 14:36:02 +01:00
2019-05-01 07:47:37 -07:00
2018-11-19 19:03:46 -07:00
2019-04-08 22:56:14 +02:00
2018-12-06 13:57:03 +01:00
2019-04-16 15:38:07 +02:00
2018-11-30 13:29:04 +00:00
2019-03-07 18:32:03 -08:00
2019-01-04 13:13:48 -08:00
2019-01-30 20:51:47 -05:00
2019-04-19 14:07:40 -07:00
2019-02-20 07:22:17 -07:00
2019-02-20 07:22:10 -07:00
2018-12-06 15:45:46 +01:00
2019-02-08 15:02:49 -08:00
2019-03-05 21:07:19 -08:00
2019-05-07 14:31:03 +02:00
2019-03-12 10:04:03 -07:00
2018-12-03 17:11:02 -08:00
2019-05-08 22:14:36 +02:00
2019-03-15 15:29:47 -07:00
2019-02-07 16:38:35 +01:00
2019-02-07 00:13:27 +01:00
2018-12-10 10:17:45 +01:00
2019-04-06 10:48:35 -06:00
2019-05-01 08:38:47 -06:00
2019-01-11 18:05:40 -08:00
2019-04-30 12:37:51 +02:00
2019-04-09 15:14:49 -06:00
2018-12-22 12:15:29 +01:00