]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ARM: OMAP: Fix SRAM W+X mapping
authorTony Lindgren <tony@atomide.com>
Wed, 21 Mar 2018 15:16:29 +0000 (08:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Apr 2018 12:27:32 +0000 (14:27 +0200)
commit37496fe93169216f56d8de3e6b15c59712374915
tree1db882520815e76ce8caa87d1a4d13571b269895
parentae0a11b2bd3317491d88d809dea044b4a7fa12a8
ARM: OMAP: Fix SRAM W+X mapping

commit eb85a355c3afd9379f5953cfe2df73632d14c884 upstream.

We are still using custom SRAM code for some SoCs and are not marking
the PM code mapped to SRAM as read-only and executable after we're
done. With CONFIG_DEBUG_WX=y, we will get "Found insecure W+X mapping
at address" warning.

Let's fix this issue the same way as commit 728bbe75c82f ("misc: sram:
Introduce support code for protect-exec sram type") is doing for
drivers/misc/sram-exec.c.

On omap3, we need to restore SRAM when returning from off mode after
idle, so init time configuration is not enough.

And as we no longer have users for omap_sram_push_address() we can
make it static while at it.

Note that eventually we should be using sram-exec.c for all SoCs.

Cc: stable@vger.kernel.org # v4.12+
Cc: Dave Gerlach <d-gerlach@ti.com>
Reported-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/plat-omap/include/plat/sram.h
arch/arm/plat-omap/sram.c