[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOJsxLFXts1USPU827A1zaZsggER7CVzZah7TGKzNHzqF8Ttsg@mail.gmail.com>
Date: Sun, 17 Jan 2016 12:02:53 +0200
From: Pekka Enberg <penberg@...nel.org>
To: Mika Penttilä <mika.penttila@...tfour.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] mm: make apply_to_page_range more robust
On Fri, Jan 15, 2016 at 7:41 AM, Mika Penttilä
<mika.penttila@...tfour.com> wrote:
> Recent changes (4.4.0+) in module loader triggered oops on ARM. While
> loading a module, size in :
>
> apply_to_page_range(struct mm_struct *mm, unsigned long addr, unsigned
> long size, pte_fn_t fn, void *data);
>
> can be 0 triggering the bug BUG_ON(addr >= end);.
>
> Fix by letting call with zero size succeed.
>
> --Mika
>
> Signed-off-by: mika.penttila@...tfour.com
Reviewed-by: Pekka Enberg <penberg@...nel.org>
We could also replace that BUG_ON() with a WARN_ON() and return -EINVAL.
> ---
>
> diff --git a/mm/memory.c b/mm/memory.c
> index c387430..c3d1a2e 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1884,6 +1884,9 @@ int apply_to_page_range(struct mm_struct *mm,
> unsigned long addr,
> unsigned long end = addr + size;
> int err;
>
> + if (!size)
> + return 0;
> +
> BUG_ON(addr >= end);
> pgd = pgd_offset(mm, addr);
> do {
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@...ck.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>
Powered by blists - more mailing lists