[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c11ebd80-0692-b001-42e4-59a8130af056@redhat.com>
Date: Mon, 1 Jul 2019 07:43:33 -0400
From: Laura Abbott <labbott@...hat.com>
To: Doug Berger <opendmb@...il.com>,
linux-arm-kernel@...ts.infradead.org
Cc: Russell King <linux@...linux.org.uk>,
Mike Rapoport <rppt@...ux.ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Florian Fainelli <f.fainelli@...il.com>,
Rob Herring <robh@...nel.org>,
"Steven Rostedt (VMware)" <rostedt@...dmis.org>,
Peng Fan <peng.fan@....com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ARM: mm: only adjust sections of valid mm structures
On 6/27/19 5:32 PM, Doug Berger wrote:
> A timing hazard exists when an early fork/exec thread begins
> exiting and sets its mm pointer to NULL while a separate core
> tries to update the section information.
>
> This commit ensures that the mm pointer is not NULL before
> setting its section parameters. The arguments provided by
> commit 11ce4b33aedc ("ARM: 8672/1: mm: remove tasklist locking
> from update_sections_early()") are equally valid for not
> requiring grabbing the task_lock around this check.
>
> Fixes: 08925c2f124f ("ARM: 8464/1: Update all mm structures with section adjustments")
> Signed-off-by: Doug Berger <opendmb@...il.com>
> ---
> arch/arm/mm/init.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index be0b42937888..bdc70dff477b 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -616,7 +616,8 @@ static void update_sections_early(struct section_perm perms[], int n)
> if (t->flags & PF_KTHREAD)
> continue;
> for_each_thread(t, s)
> - set_section_perms(perms, n, true, s->mm);
> + if (s->mm)
> + set_section_perms(perms, n, true, s->mm);
> }
> set_section_perms(perms, n, true, current->active_mm);
> set_section_perms(perms, n, true, &init_mm);
>
Acked-by: Laura Abbott <labbott@...hat.com>
Powered by blists - more mailing lists