[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e0c5b94c-12b2-8250-204f-df5cbe5e4662@infradead.org>
Date: Tue, 21 Nov 2017 08:50:35 -0800
From: Randy Dunlap <rdunlap@...radead.org>
To: Aleksandar Markovic <aleksandar.markovic@...rk.com>,
linux-mips@...ux-mips.org
Cc: Miodrag Dinic <miodrag.dinic@...s.com>,
Aleksandar Markovic <aleksandar.markovic@...s.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Dengcheng Zhu <dengcheng.zhu@...s.com>,
Ding Tianhong <dingtianhong@...wei.com>,
Douglas Leung <douglas.leung@...s.com>,
Frederic Weisbecker <frederic@...nel.org>,
Goran Ferenc <goran.ferenc@...s.com>,
Ingo Molnar <mingo@...nel.org>,
James Cowgill <James.Cowgill@...tec.com>,
James Hogan <james.hogan@...s.com>,
Jonathan Corbet <corbet@....net>, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, Marc Zyngier <marc.zyngier@....com>,
Matt Redfearn <matt.redfearn@...s.com>,
Mimi Zohar <zohar@...ux.vnet.ibm.com>,
Paul Burton <paul.burton@...s.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Petar Jovanovic <petar.jovanovic@...s.com>,
Raghu Gandham <raghu.gandham@...s.com>,
Ralf Baechle <ralf@...ux-mips.org>,
Thomas Gleixner <tglx@...utronix.de>,
Tom Saeger <tom.saeger@...cle.com>
Subject: Re: [PATCH v2] MIPS: Add nonxstack=on|off kernel parameter
On 11/21/2017 05:56 AM, Aleksandar Markovic wrote:
> From: Miodrag Dinic <miodrag.dinic@...s.com>
>
> Add a new kernel parameter to override the default behavior related
> to the decision whether to set up stack as non-executable in function
> mips_elf_read_implies_exec().
>
> The new parameter is used to control non executable stack and heap,
> regardless of PT_GNU_STACK entry. This does apply to both stack and
> heap, despite the name.
>
> Allowed values:
>
> nonxstack=on Force non-exec stack & heap
> nonxstack=off Force executable stack & heap
>
> If this parameter is omitted, kernel behavior remains the same as it
> was before this patch is applied.
>
> This functionality is convenient during debugging and is especially
> useful for Android development where non-exec stack is required.
>
> Signed-off-by: Miodrag Dinic <miodrag.dinic@...s.com>
> Signed-off-by: Aleksandar Markovic <aleksandar.markovic@...s.com>
> ---
> Documentation/admin-guide/kernel-parameters.txt | 11 +++++++
> arch/mips/kernel/elf.c | 39 +++++++++++++++++++++++++
> 2 files changed, 50 insertions(+)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index b74e133..99464ee 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -2614,6 +2614,17 @@
> noexec32=off: disable non-executable mappings
> read implies executable mappings
>
> + nonxstack [MIPS]
> + Force setting up stack and heap as non-executable or
> + executable regardless of PT_GNU_STACK entry. Both
> + stack and heap are affected, despite the name. Valid
> + arguments: on, off.
> + nonxstack=on: Force non-executable stack and heap
> + nonxstack=off: Force executable stack and heap
> + If ommited, stack and heap will or will not be set
omitted,
> + up as non-executable depending on PT_GNU_STACK
> + entry and possibly other factors.
> +
> nofpu [MIPS,SH] Disable hardware FPU at boot time.
>
> nofxsr [BUGS=X86-32] Disables x86 floating point extended
> diff --git a/arch/mips/kernel/elf.c b/arch/mips/kernel/elf.c
> index 731325a..28ef7f3 100644
> --- a/arch/mips/kernel/elf.c
> +++ b/arch/mips/kernel/elf.c
> @@ -326,8 +326,47 @@ void mips_set_personality_nan(struct arch_elf_state *state)
> }
> }
>
> +static int nonxstack = EXSTACK_DEFAULT;
> +
> +/*
> + * kernel parameter: nonxstack=on|off
> + *
> + * Force setting up stack and heap as non-executable or
> + * executable regardless of PT_GNU_STACK entry. Both
> + * stack and heap are affected, despite the name. Valid
> + * arguments: on, off.
> + *
> + * nonxstack=on: Force non-executable stack and heap
> + * nonxstack=off: Force executable stack and heap
> + *
> + * If ommited, stack and heap will or will not be set
omitted
> + * up as non-executable depending on PT_GNU_STACK
> + * entry and possibly other factors.
> + */
--
~Randy
Powered by blists - more mailing lists