]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ARC: mm: allow mprotect to make stack mappings executable
authorVineet Gupta <vgupta@synopsys.com>
Wed, 11 Jul 2018 17:42:20 +0000 (10:42 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Feb 2019 04:53:01 +0000 (04:53 +0000)
commit76acfe87f6b7f6f12169ec93804f377a458981f0
treea37fb3710330969b55dd8706836bb5da3747c7f6
parent475f35e68e6be91ad2d69d05eeafdc9d28773ed8
ARC: mm: allow mprotect to make stack mappings executable

BugLink: http://bugs.launchpad.net/bugs/1812229
commit 93312b6da4df31e4102ce5420e6217135a16c7ea upstream.

mprotect(EXEC) was failing for stack mappings as default vm flags was
missing MAYEXEC.

This was triggered by glibc test suite nptl/tst-execstack testcase

What is surprising is that despite running LTP for years on, we didn't
catch this issue as it lacks a directed test case.

gcc dejagnu tests with nested functions also requiring exec stack work
fine though because they rely on the GNU_STACK segment spit out by
compiler and handled in kernel elf loader.

This glibc case is different as the stack is non exec to begin with and
a dlopen of shared lib with GNU_STACK segment triggers the exec stack
proceedings using a mprotect(PROT_EXEC) which was broken.

CC: stable@vger.kernel.org
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/arc/include/asm/page.h