Re: [Phishing Risk] [External] [PATCH] mm: add GFP_ATOMIC flag after local_lock_irqsave

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

 



On Mon, Jul 5, 2021 at 9:57 PM Wang Qing <wangqing@xxxxxxxx> wrote:
>
> Use GFP_ATOMIC when local_lock_irqsave in __alloc_pages_bulk
>
> Reported-by: syzbot+e45919db2eab5e837646@xxxxxxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Wang Qing <wangqing@xxxxxxxx>
> ---
>  mm/page_alloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index d6e94cc..3016ba5
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -5309,7 +5309,7 @@ unsigned long __alloc_pages_bulk(gfp_t gfp, int preferred_nid,
>                 }
>                 nr_account++;
>
> -               prep_new_page(page, 0, gfp, 0);
> +               prep_new_page(page, 0, gfp | GFP_ATOMIC, 0);

Hi Wang Qing,

I didn't get the point here. IIUC, prep_new_page() will not allocate
memory. So why do we need GFP_ATOMIC? What I missed here?

Thanks.

>                 if (page_list)
>                         list_add(&page->lru, page_list);
>                 else
> --
> 2.7.4
>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux