commit | c46c16f98ddfe6662f2cab0b60803d00e87e7091 | [log] [tgz] |
---|---|---|
author | Miaohe Lin <linmiaohe@huawei.com> | Sun Apr 28 11:03:42 2024 +0800 |
committer | openeuler-sync-bot <openeuler.syncbot@gmail.com> | Mon Apr 29 15:39:22 2024 +0800 |
tree | 9b0bc27ba9929ef30144fb8929da26e72d0e3c3d | |
parent | b1d9c439ae95ddb164d47ac3f3c9de71998f9290 [diff] |
mm/madvise: fix potential pte_unmap_unlock pte error mainline inclusion from mainline-v5.19-rc1 commit f3b9e8cc8b09ba3b41bb068c24a1061e8a70d26f category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9JPDJ Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f3b9e8cc8b09ba3b41bb068c24a1061e8a70d26f -------------------------------- We can't assume pte_offset_map_lock will return same orig_pte value. So it's necessary to reacquire the orig_pte or pte_unmap_unlock will unmap the stale pte. Link: https://lkml.kernel.org/r/20220416081416.23304-1-linmiaohe@huawei.com Fixes: 9c276cc65a58 ("mm: introduce MADV_COLD") Fixes: 854e9ed09ded ("mm: support madvise(MADV_FREE)") Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ma Wupeng <mawupeng1@huawei.com> (cherry picked from commit 445475d0030d30716e259236bb48863d7ecf34cc)