Re: [PATCH] mm: arm64: Fix the out-of-bounds issue in contpte_clear_young_dirty_ptes

From: David Hildenbrand
Date: Fri May 24 2024 - 03:05:01 EST


On 24.05.24 02:54, Barry Song wrote:
From: Barry Song <v-songbaohua@xxxxxxxx>

We are passing a huge nr to __clear_young_dirty_ptes() right
now. While we should pass the number of pages, we are actually
passing CONT_PTE_SIZE. This is causing lots of crashes of
MADV_FREE, panic oops could vary everytime.

Fixes: 89e86854fb0a ("mm/arm64: override clear_young_dirty_ptes() batch helper")
Cc: Lance Yang <ioworker0@xxxxxxxxx>
Cc: Barry Song <21cnbao@xxxxxxxxx>
Cc: Ryan Roberts <ryan.roberts@xxxxxxx>
Cc: David Hildenbrand <david@xxxxxxxxxx>
Cc: Jeff Xie <xiehuan09@xxxxxxxxx>
Cc: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>
Cc: Michal Hocko <mhocko@xxxxxxxx>
Cc: Minchan Kim <minchan@xxxxxxxxxx>
Cc: Muchun Song <songmuchun@xxxxxxxxxxxxx>
Cc: Peter Xu <peterx@xxxxxxxxxx>
Cc: Yang Shi <shy828301@xxxxxxxxx>
Cc: Yin Fengwei <fengwei.yin@xxxxxxxxx>
Cc: Zach O'Keefe <zokeefe@xxxxxxxxxx>
Cc: Catalin Marinas <catalin.marinas@xxxxxxx>
Cc: Will Deacon <will@xxxxxxxxxx>
Signed-off-by: Barry Song <v-songbaohua@xxxxxxxx>
---

LGTM

Acked-by: David Hildenbrand <david@xxxxxxxxxx>

--
Cheers,

David / dhildenb