Commit f5d09de
mm: use aligned address in copy_user_gigantic_page()
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/20241028145656.932941-2-wangkefeng.wang@huawei.com
Fixes: 530dd99 ("mm: memory: improve copy_user_large_folio()")
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>1 parent 8aca2bc commit f5d09de
2 files changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5340 | 5340 | | |
5341 | 5341 | | |
5342 | 5342 | | |
5343 | | - | |
| 5343 | + | |
5344 | 5344 | | |
5345 | 5345 | | |
5346 | 5346 | | |
| |||
6643 | 6643 | | |
6644 | 6644 | | |
6645 | 6645 | | |
6646 | | - | |
6647 | | - | |
| 6646 | + | |
6648 | 6647 | | |
6649 | 6648 | | |
6650 | 6649 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6852 | 6852 | | |
6853 | 6853 | | |
6854 | 6854 | | |
6855 | | - | |
| 6855 | + | |
6856 | 6856 | | |
6857 | 6857 | | |
6858 | 6858 | | |
6859 | | - | |
| 6859 | + | |
6860 | 6860 | | |
6861 | 6861 | | |
| 6862 | + | |
6862 | 6863 | | |
6863 | 6864 | | |
6864 | 6865 | | |
| |||
0 commit comments