ARM: 8874/1: mm: only adjust sections of valid mm structures
authorDoug Berger <opendmb@gmail.com>
Mon, 1 Jul 2019 17:50:11 +0000 (18:50 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Fri, 23 Aug 2019 10:32:36 +0000 (11:32 +0100)
commitc51bc12d06b3a5494fbfcbd788a8e307932a06e9
tree1be152722286130b0930674e5110f9492d088b6b
parentd1abaeb3be7b5fa6d7a1fbbd2e14e3310005c4c1
ARM: 8874/1: mm: only adjust sections of valid mm structures

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@gmail.com>
Acked-by: Laura Abbott <labbott@redhat.com>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Rob Herring <robh@kernel.org>
Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/mm/init.c