Re: [PATCH v1 10/36] mm: sanity-check maximum folio size in folio_set_order()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


(追記) (追記ここまで)



* David Hildenbrand <david@xxxxxxxxxx> [250827 18:05]:
> Let's sanity-check in folio_set_order() whether we would be trying to
> create a folio with an order that would make it exceed MAX_FOLIO_ORDER.
>
> This will enable the check whenever a folio/compound page is initialized
> through prepare_compound_head() / prepare_compound_page().
>
> Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>
> Signed-off-by: David Hildenbrand <david@xxxxxxxxxx>
Reviewed-by: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx>
> ---
> mm/internal.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/mm/internal.h b/mm/internal.h
> index 45da9ff5694f6..9b0129531d004 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -755,6 +755,7 @@ static inline void folio_set_order(struct folio *folio, unsigned int order)
> {
> 	if (WARN_ON_ONCE(!order || !folio_test_large(folio)))
> 		return;
> +	VM_WARN_ON_ONCE(order > MAX_FOLIO_ORDER);
>
> 	folio->_flags_1 = (folio->_flags_1 & ~0xffUL) | order;
> #ifdef NR_PAGES_IN_LARGE_FOLIO
> -- 
> 2.50.1
>
>

[Index of Archives] [Linux Filesystems] [Linux SCSI] [Linux RAID] [Git] [Kernel Newbies] [Linux Newbie] [Security] [Netfilter] [Bugtraq] [Yosemite News] [MIPS Linux] [ARM Linux] [Linux Security] [Samba] [Device Mapper]

(追記) (追記ここまで)
Powered by Linux

AltStyle によって変換されたページ (->オリジナル) /