Re: [PATCH, REGRESSION v4] mm: make apply_to_page_range more robust

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

 



On Fri, 22 Jan 2016, Mika Penttilä wrote:

> diff --git a/mm/memory.c b/mm/memory.c
> index 30991f8..9178ee6 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1871,7 +1871,9 @@ int apply_to_page_range(struct mm_struct *mm, unsigned long addr,
>         unsigned long end = addr + size;
>         int err;
>  
> -       BUG_ON(addr >= end);
> +       if (WARN_ON(addr >= end))
> +               return -EINVAL;
> +
>         pgd = pgd_offset(mm, addr);
>         do {
>                 next = pgd_addr_end(addr, end);

This would be fine as a second patch in a 2-patch series.  The first patch 
should fix change_memory_common() for numpages == 0 by returning without 
ever calling this function and triggering the WARN_ON().  Let's fix the 
problem.

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