Commit cb12d61
mm: use aligned address in copy_user_gigantic_page()
commit f5d09de upstream.
In current kernel, hugetlb_wp() calls copy_user_large_folio() with the
fault address. Where the fault address may be not aligned with the huge
page size. Then, copy_user_large_folio() may call
copy_user_gigantic_page() with the address, while
copy_user_gigantic_page() requires the address to be huge page size
aligned. So, this may cause memory corruption or information leak,
addtional, use more obvious naming 'addr_hint' instead of 'addr' for
copy_user_gigantic_page().
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 530dd99 ("mm: memory: improve copy_user_large_folio()")
Signed-off-by: Kefeng Wang <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Cc: Huang Ying <[email protected]>
Cc: Matthew Wilcox (Oracle) <[email protected]>
Cc: Muchun Song <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent b79b6fe commit cb12d61
2 files changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5333 | 5333 | | |
5334 | 5334 | | |
5335 | 5335 | | |
5336 | | - | |
| 5336 | + | |
5337 | 5337 | | |
5338 | 5338 | | |
5339 | 5339 | | |
| |||
6632 | 6632 | | |
6633 | 6633 | | |
6634 | 6634 | | |
6635 | | - | |
6636 | | - | |
| 6635 | + | |
6637 | 6636 | | |
6638 | 6637 | | |
6639 | 6638 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6817 | 6817 | | |
6818 | 6818 | | |
6819 | 6819 | | |
6820 | | - | |
| 6820 | + | |
6821 | 6821 | | |
6822 | 6822 | | |
6823 | 6823 | | |
6824 | | - | |
| 6824 | + | |
6825 | 6825 | | |
6826 | 6826 | | |
| 6827 | + | |
6827 | 6828 | | |
6828 | 6829 | | |
6829 | 6830 | | |
| |||
0 commit comments