All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney@caviumnetworks.com>
To: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Cc: <daniel.sanders@imgtec.com>, <linux-mips@linux-mips.org>,
	<cernekee@gmail.com>, <Zubair.Kakakhel@imgtec.com>,
	<geert+renesas@glider.be>, <david.daney@cavium.com>,
	<peterz@infradead.org>, <heiko.carstens@de.ibm.com>,
	<paul.gortmaker@windriver.com>, <behanw@converseincode.com>,
	<macro@linux-mips.org>, <cl@linux.com>, <pkarat@mvista.com>,
	<linux@roeck-us.net>, <tkhai@yandex.ru>, <james.hogan@imgtec.com>,
	<alexinbeijing@gmail.com>, <rusty@rustcorp.com.au>,
	<Steven.Hill@imgtec.com>, <lars.persson@axis.com>,
	<aleksey.makarov@auriga.com>, <paul.burton@imgtec.com>,
	<linux-kernel@vger.kernel.org>, <ralf@linux-mips.org>,
	<luto@amacapital.net>, <dahi@linux.vnet.ibm.com>,
	<markos.chandras@imgtec.com>, <eunb.song@samsung.com>,
	<kumba@gentoo.org>
Subject: Re: [PATCH v4 3/3] MIPS: set stack/data protection as non-executable
Date: Wed, 5 Aug 2015 16:55:56 -0700	[thread overview]
Message-ID: <55C2A28C.7000809@caviumnetworks.com> (raw)
In-Reply-To: <20150805234936.20722.60927.stgit@ubuntu-yegoshin>

On 08/05/2015 04:49 PM, Leonid Yegoshin wrote:
> This is a last step of 3 patches which shift FPU emulation out of
> stack into protected area. So, it disables a default executable stack.
>

NAK.

You cannot change the default.

If you want a non-executable stack, the program has to request it with 
the proper annotations in its ELF file.

David Daney.


> Additionally, it sets a default data area non-executable protection.
>
> Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
> ---
>   arch/mips/include/asm/page.h |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
> index 89dd7fed1a57..0b6cec4a1b80 100644
> --- a/arch/mips/include/asm/page.h
> +++ b/arch/mips/include/asm/page.h
> @@ -228,7 +228,7 @@ extern int __virt_addr_valid(const volatile void *kaddr);
>   #define virt_addr_valid(kaddr)						\
>   	__virt_addr_valid((const volatile void *) (kaddr))
>
> -#define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | VM_EXEC | \
> +#define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | \
>   				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
>
>   #define UNCAC_ADDR(addr)	((addr) - PAGE_OFFSET + UNCAC_BASE)
>

WARNING: multiple messages have this Message-ID (diff)
From: David Daney <ddaney@caviumnetworks.com>
To: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Cc: daniel.sanders@imgtec.com, linux-mips@linux-mips.org,
	cernekee@gmail.com, Zubair.Kakakhel@imgtec.com,
	geert+renesas@glider.be, david.daney@cavium.com,
	peterz@infradead.org, heiko.carstens@de.ibm.com,
	paul.gortmaker@windriver.com, behanw@converseincode.com,
	macro@linux-mips.org, cl@linux.com, pkarat@mvista.com,
	linux@roeck-us.net, tkhai@yandex.ru, james.hogan@imgtec.com,
	alexinbeijing@gmail.com, rusty@rustcorp.com.au,
	Steven.Hill@imgtec.com, lars.persson@axis.com,
	aleksey.makarov@auriga.com, paul.burton@imgtec.com,
	linux-kernel@vger.kernel.org, ralf@linux-mips.org,
	luto@amacapital.net, dahi@linux.vnet.ibm.com,
	markos.chandras@imgtec.com, eunb.song@samsung.com,
	kumba@gentoo.org
Subject: Re: [PATCH v4 3/3] MIPS: set stack/data protection as non-executable
Date: Wed, 5 Aug 2015 16:55:56 -0700	[thread overview]
Message-ID: <55C2A28C.7000809@caviumnetworks.com> (raw)
Message-ID: <20150805235556.U0uMDXJmO28l_yv1l9xKUpJvsQ63VNOQaBJplEhHhpI@z> (raw)
In-Reply-To: <20150805234936.20722.60927.stgit@ubuntu-yegoshin>

On 08/05/2015 04:49 PM, Leonid Yegoshin wrote:
> This is a last step of 3 patches which shift FPU emulation out of
> stack into protected area. So, it disables a default executable stack.
>

NAK.

You cannot change the default.

If you want a non-executable stack, the program has to request it with 
the proper annotations in its ELF file.

David Daney.


> Additionally, it sets a default data area non-executable protection.
>
> Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
> ---
>   arch/mips/include/asm/page.h |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
> index 89dd7fed1a57..0b6cec4a1b80 100644
> --- a/arch/mips/include/asm/page.h
> +++ b/arch/mips/include/asm/page.h
> @@ -228,7 +228,7 @@ extern int __virt_addr_valid(const volatile void *kaddr);
>   #define virt_addr_valid(kaddr)						\
>   	__virt_addr_valid((const volatile void *) (kaddr))
>
> -#define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | VM_EXEC | \
> +#define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | \
>   				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
>
>   #define UNCAC_ADDR(addr)	((addr) - PAGE_OFFSET + UNCAC_BASE)
>

  parent reply	other threads:[~2015-08-05 23:56 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05 23:49 [PATCH v4 0/3] MIPS executable stack protection Leonid Yegoshin
2015-08-05 23:49 ` Leonid Yegoshin
2015-08-05 23:49 ` [PATCH v4 1/3] MIPS: mips_flush_cache_range is added Leonid Yegoshin
2015-08-05 23:49   ` Leonid Yegoshin
2015-08-05 23:49 ` [PATCH v4 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack Leonid Yegoshin
2015-08-05 23:49   ` Leonid Yegoshin
2015-08-05 23:49 ` [PATCH v4 3/3] MIPS: set stack/data protection as non-executable Leonid Yegoshin
2015-08-05 23:49   ` Leonid Yegoshin
2015-08-05 23:55   ` Paul Burton
2015-08-05 23:55     ` Paul Burton
2015-08-06  0:06     ` Leonid Yegoshin
2015-08-06  0:06       ` Leonid Yegoshin
2015-08-06  0:14       ` David Daney
2015-08-06  0:14         ` David Daney
2015-08-06  0:23         ` Leonid Yegoshin
2015-08-06  0:23           ` Leonid Yegoshin
2015-08-06  0:37           ` David Daney
2015-08-06  0:37             ` David Daney
2015-08-06  0:46             ` Leonid Yegoshin
2015-08-06  0:46               ` Leonid Yegoshin
2015-08-06  1:07               ` David Daney
2015-08-06  1:07                 ` David Daney
2015-08-06  0:40           ` Paul Burton
2015-08-06  0:40             ` Paul Burton
2015-08-05 23:55   ` David Daney [this message]
2015-08-05 23:55     ` David Daney
2015-08-06  0:00 ` [PATCH v4 0/3] MIPS executable stack protection David Daney
2015-08-06  0:00   ` David Daney
2015-08-06  0:02   ` Leonid Yegoshin
2015-08-06  0:02     ` Leonid Yegoshin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55C2A28C.7000809@caviumnetworks.com \
    --to=ddaney@caviumnetworks.com \
    --cc=Leonid.Yegoshin@imgtec.com \
    --cc=Steven.Hill@imgtec.com \
    --cc=Zubair.Kakakhel@imgtec.com \
    --cc=aleksey.makarov@auriga.com \
    --cc=alexinbeijing@gmail.com \
    --cc=behanw@converseincode.com \
    --cc=cernekee@gmail.com \
    --cc=cl@linux.com \
    --cc=dahi@linux.vnet.ibm.com \
    --cc=daniel.sanders@imgtec.com \
    --cc=david.daney@cavium.com \
    --cc=eunb.song@samsung.com \
    --cc=geert+renesas@glider.be \
    --cc=heiko.carstens@de.ibm.com \
    --cc=james.hogan@imgtec.com \
    --cc=kumba@gentoo.org \
    --cc=lars.persson@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux@roeck-us.net \
    --cc=luto@amacapital.net \
    --cc=macro@linux-mips.org \
    --cc=markos.chandras@imgtec.com \
    --cc=paul.burton@imgtec.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=peterz@infradead.org \
    --cc=pkarat@mvista.com \
    --cc=ralf@linux-mips.org \
    --cc=rusty@rustcorp.com.au \
    --cc=tkhai@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.