Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 9951960f authored by Tengfei Fan's avatar Tengfei Fan Committed by Gerrit - the friendly Code Review server
Browse files

mm: Using init_mm in apply_to_page_range() if addr >= PAGE_OFFSET



Avoid panic be caused when apply_to_page_range() is called in pte_update()
if mm != &init_mm and addr >= PAGE_OFFSET.

In apply_to_page_range(), init_mm and other struct mm_struct have different
paths to get pte. init_mm use pte_alloc_kernel(), this function needn't to
use pte's spinlock, other sturct mm_sturct use pte_alloc_map_lock(), this
function need to use pte's spinlock.

The paging mechanism haven't start when kernel's page table is builded. So
we cannot initialize struct pages which kernel's page table use at this
time, so the ptl member of struct page cannot be initialized alse.

pte_alloc_map_lock() will be called in apply_to_page_range() when mm !=
&init_mm and addr >= PAGE_OFFSET, so a panic will be caused.

Change-Id: I3eff143e78e262c6d953f9fa2183b26b1f1aa2dd
Signed-off-by: default avatarTengfei Fan <tengfeif@codeaurora.org>
parent 47906484
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment