All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mark protection_map as __ro_after_init
@ 2017-05-10 17:44 ` Daniel Micay
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Micay @ 2017-05-10 17:44 UTC (permalink / raw)
  To: Andrew Morton, linux-mm; +Cc: Kees Cook, kernel-hardening, Daniel Micay

The protection map is only modified by per-arch init code so it can be
protected from writes after the init code runs.

This change was extracted from PaX where it's part of KERNEXEC.

Signed-off-by: Daniel Micay <danielmicay@gmail.com>
---
 mm/mmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index f82741e199c0..3bd5ecd20d4d 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -94,7 +94,7 @@ static void unmap_region(struct mm_struct *mm,
  *								w: (no) no
  *								x: (yes) yes
  */
-pgprot_t protection_map[16] = {
+pgprot_t protection_map[16] __ro_after_init = {
 	__P000, __P001, __P010, __P011, __P100, __P101, __P110, __P111,
 	__S000, __S001, __S010, __S011, __S100, __S101, __S110, __S111
 };
-- 
2.12.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [kernel-hardening] [PATCH] mark protection_map as __ro_after_init
@ 2017-05-10 17:44 ` Daniel Micay
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Micay @ 2017-05-10 17:44 UTC (permalink / raw)
  To: Andrew Morton, linux-mm; +Cc: Kees Cook, kernel-hardening, Daniel Micay

The protection map is only modified by per-arch init code so it can be
protected from writes after the init code runs.

This change was extracted from PaX where it's part of KERNEXEC.

Signed-off-by: Daniel Micay <danielmicay@gmail.com>
---
 mm/mmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index f82741e199c0..3bd5ecd20d4d 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -94,7 +94,7 @@ static void unmap_region(struct mm_struct *mm,
  *								w: (no) no
  *								x: (yes) yes
  */
-pgprot_t protection_map[16] = {
+pgprot_t protection_map[16] __ro_after_init = {
 	__P000, __P001, __P010, __P011, __P100, __P101, __P110, __P111,
 	__S000, __S001, __S010, __S011, __S100, __S101, __S110, __S111
 };
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mark protection_map as __ro_after_init
  2017-05-10 17:44 ` [kernel-hardening] " Daniel Micay
  (?)
@ 2017-05-10 18:20   ` Kees Cook
  -1 siblings, 0 replies; 5+ messages in thread
From: Kees Cook @ 2017-05-10 18:20 UTC (permalink / raw)
  To: Daniel Micay; +Cc: Andrew Morton, Linux-MM, kernel-hardening, LKML

On Wed, May 10, 2017 at 10:44 AM, Daniel Micay <danielmicay@gmail.com> wrote:
> The protection map is only modified by per-arch init code so it can be
> protected from writes after the init code runs.
>
> This change was extracted from PaX where it's part of KERNEXEC.
>
> Signed-off-by: Daniel Micay <danielmicay@gmail.com>

Thanks!

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  mm/mmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/mmap.c b/mm/mmap.c
> index f82741e199c0..3bd5ecd20d4d 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -94,7 +94,7 @@ static void unmap_region(struct mm_struct *mm,
>   *                                                             w: (no) no
>   *                                                             x: (yes) yes
>   */
> -pgprot_t protection_map[16] = {
> +pgprot_t protection_map[16] __ro_after_init = {
>         __P000, __P001, __P010, __P011, __P100, __P101, __P110, __P111,
>         __S000, __S001, __S010, __S011, __S100, __S101, __S110, __S111
>  };
> --
> 2.12.2
>



-- 
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mark protection_map as __ro_after_init
@ 2017-05-10 18:20   ` Kees Cook
  0 siblings, 0 replies; 5+ messages in thread
From: Kees Cook @ 2017-05-10 18:20 UTC (permalink / raw)
  To: Daniel Micay; +Cc: Andrew Morton, Linux-MM, kernel-hardening, LKML

On Wed, May 10, 2017 at 10:44 AM, Daniel Micay <danielmicay@gmail.com> wrote:
> The protection map is only modified by per-arch init code so it can be
> protected from writes after the init code runs.
>
> This change was extracted from PaX where it's part of KERNEXEC.
>
> Signed-off-by: Daniel Micay <danielmicay@gmail.com>

Thanks!

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  mm/mmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/mmap.c b/mm/mmap.c
> index f82741e199c0..3bd5ecd20d4d 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -94,7 +94,7 @@ static void unmap_region(struct mm_struct *mm,
>   *                                                             w: (no) no
>   *                                                             x: (yes) yes
>   */
> -pgprot_t protection_map[16] = {
> +pgprot_t protection_map[16] __ro_after_init = {
>         __P000, __P001, __P010, __P011, __P100, __P101, __P110, __P111,
>         __S000, __S001, __S010, __S011, __S100, __S101, __S110, __S111
>  };
> --
> 2.12.2
>



-- 
Kees Cook
Pixel Security

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [kernel-hardening] Re: [PATCH] mark protection_map as __ro_after_init
@ 2017-05-10 18:20   ` Kees Cook
  0 siblings, 0 replies; 5+ messages in thread
From: Kees Cook @ 2017-05-10 18:20 UTC (permalink / raw)
  To: Daniel Micay; +Cc: Andrew Morton, Linux-MM, kernel-hardening, LKML

On Wed, May 10, 2017 at 10:44 AM, Daniel Micay <danielmicay@gmail.com> wrote:
> The protection map is only modified by per-arch init code so it can be
> protected from writes after the init code runs.
>
> This change was extracted from PaX where it's part of KERNEXEC.
>
> Signed-off-by: Daniel Micay <danielmicay@gmail.com>

Thanks!

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  mm/mmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/mmap.c b/mm/mmap.c
> index f82741e199c0..3bd5ecd20d4d 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -94,7 +94,7 @@ static void unmap_region(struct mm_struct *mm,
>   *                                                             w: (no) no
>   *                                                             x: (yes) yes
>   */
> -pgprot_t protection_map[16] = {
> +pgprot_t protection_map[16] __ro_after_init = {
>         __P000, __P001, __P010, __P011, __P100, __P101, __P110, __P111,
>         __S000, __S001, __S010, __S011, __S100, __S101, __S110, __S111
>  };
> --
> 2.12.2
>



-- 
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-05-10 18:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-10 17:44 [PATCH] mark protection_map as __ro_after_init Daniel Micay
2017-05-10 17:44 ` [kernel-hardening] " Daniel Micay
2017-05-10 18:20 ` Kees Cook
2017-05-10 18:20   ` [kernel-hardening] " Kees Cook
2017-05-10 18:20   ` Kees Cook

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.