[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1601191420030.7346@chino.kir.corp.google.com>
Date: Tue, 19 Jan 2016 14:21:27 -0800 (PST)
From: David Rientjes <rientjes@...gle.com>
To: Mika Penttilä <mika.penttila@...tfour.com>
cc: LKML <linux-kernel@...r.kernel.org>, linux-mm@...ck.org
Subject: Re: [PATCH] mm: make apply_to_page_range more robust
On Fri, 15 Jan 2016, Mika Penttilä 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
> ---
>
> 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 {
What is calling apply_to_page_range() with size == 0? I'm not sure we
should be adding "robust"ness here and that size == 0 is actually an
indication of a bug somewhere else that we want to know about.
Btw, your patch is line-wrapped and your sign-off-line doesn't include
your full name.
Powered by blists - more mailing lists