All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] ARM: mm: report both sections from PMD
@ 2014-02-13 19:52 ` Kees Cook
  0 siblings, 0 replies; 12+ messages in thread
From: Kees Cook @ 2014-02-13 19:52 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Catalin Marinas, Russell King, linux-kernel

On 2-level page table systems, the PMD has 2 section entries. Report
these, otherwise ARM_PTDUMP will miss reporting permission changes on
odd section boundaries.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
v3:
 - re-reorganize, drop use of pmd_sect; suggested by Catalin Marinas.
v2:
 - reorganize, suggested by Catalin Marinas.
---
 arch/arm/mm/dump.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mm/dump.c b/arch/arm/mm/dump.c
index 2b342177f5de..61cc78ae9f21 100644
--- a/arch/arm/mm/dump.c
+++ b/arch/arm/mm/dump.c
@@ -264,6 +264,9 @@ static void walk_pmd(struct pg_state *st, pud_t *pud, unsigned long start)
 			note_page(st, addr, 3, pmd_val(*pmd));
 		else
 			walk_pte(st, pmd, addr);
+
+		if (SECTION_SIZE < PMD_SIZE && pmd_large(pmd[1]))
+			note_page(st, addr + SECTION_SIZE, 3, pmd_val(pmd[1]));
 	}
 }
 
-- 
1.7.9.5


-- 
Kees Cook
Chrome OS Security

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

* [PATCH v3] ARM: mm: report both sections from PMD
@ 2014-02-13 19:52 ` Kees Cook
  0 siblings, 0 replies; 12+ messages in thread
From: Kees Cook @ 2014-02-13 19:52 UTC (permalink / raw)
  To: linux-arm-kernel

On 2-level page table systems, the PMD has 2 section entries. Report
these, otherwise ARM_PTDUMP will miss reporting permission changes on
odd section boundaries.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
v3:
 - re-reorganize, drop use of pmd_sect; suggested by Catalin Marinas.
v2:
 - reorganize, suggested by Catalin Marinas.
---
 arch/arm/mm/dump.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mm/dump.c b/arch/arm/mm/dump.c
index 2b342177f5de..61cc78ae9f21 100644
--- a/arch/arm/mm/dump.c
+++ b/arch/arm/mm/dump.c
@@ -264,6 +264,9 @@ static void walk_pmd(struct pg_state *st, pud_t *pud, unsigned long start)
 			note_page(st, addr, 3, pmd_val(*pmd));
 		else
 			walk_pte(st, pmd, addr);
+
+		if (SECTION_SIZE < PMD_SIZE && pmd_large(pmd[1]))
+			note_page(st, addr + SECTION_SIZE, 3, pmd_val(pmd[1]));
 	}
 }
 
-- 
1.7.9.5


-- 
Kees Cook
Chrome OS Security

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

* Re: [PATCH v3] ARM: mm: report both sections from PMD
  2014-02-13 19:52 ` Kees Cook
@ 2014-02-14 10:17   ` Catalin Marinas
  -1 siblings, 0 replies; 12+ messages in thread
From: Catalin Marinas @ 2014-02-14 10:17 UTC (permalink / raw)
  To: Kees Cook; +Cc: linux-arm-kernel, Russell King, linux-kernel

On Thu, Feb 13, 2014 at 07:52:30PM +0000, Kees Cook wrote:
> On 2-level page table systems, the PMD has 2 section entries. Report
> these, otherwise ARM_PTDUMP will miss reporting permission changes on
> odd section boundaries.
> 
> Signed-off-by: Kees Cook <keescook@chromium.org>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

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

* [PATCH v3] ARM: mm: report both sections from PMD
@ 2014-02-14 10:17   ` Catalin Marinas
  0 siblings, 0 replies; 12+ messages in thread
From: Catalin Marinas @ 2014-02-14 10:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 13, 2014 at 07:52:30PM +0000, Kees Cook wrote:
> On 2-level page table systems, the PMD has 2 section entries. Report
> these, otherwise ARM_PTDUMP will miss reporting permission changes on
> odd section boundaries.
> 
> Signed-off-by: Kees Cook <keescook@chromium.org>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

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

* Re: [PATCH v3] ARM: mm: report both sections from PMD
  2014-02-13 19:52 ` Kees Cook
@ 2014-02-14 17:05   ` Steve Capper
  -1 siblings, 0 replies; 12+ messages in thread
From: Steve Capper @ 2014-02-14 17:05 UTC (permalink / raw)
  To: Kees Cook; +Cc: linux-arm-kernel, Catalin Marinas, Russell King, linux-kernel

On Thu, Feb 13, 2014 at 11:52:30AM -0800, Kees Cook wrote:
> On 2-level page table systems, the PMD has 2 section entries. Report
> these, otherwise ARM_PTDUMP will miss reporting permission changes on
> odd section boundaries.
> 
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> v3:
>  - re-reorganize, drop use of pmd_sect; suggested by Catalin Marinas.
> v2:
>  - reorganize, suggested by Catalin Marinas.
> ---
>  arch/arm/mm/dump.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm/mm/dump.c b/arch/arm/mm/dump.c
> index 2b342177f5de..61cc78ae9f21 100644
> --- a/arch/arm/mm/dump.c
> +++ b/arch/arm/mm/dump.c
> @@ -264,6 +264,9 @@ static void walk_pmd(struct pg_state *st, pud_t *pud, unsigned long start)
>  			note_page(st, addr, 3, pmd_val(*pmd));
>  		else
>  			walk_pte(st, pmd, addr);
> +
> +		if (SECTION_SIZE < PMD_SIZE && pmd_large(pmd[1]))
> +			note_page(st, addr + SECTION_SIZE, 3, pmd_val(pmd[1]));
>  	}
>  }
>  
> -- 
> 1.7.9.5

This picks up an odd megabyte aligned section on my Arndale board with
short descriptors on 3.14-rc2. Behaves as expected with long descriptors
too (does nothing).

FWIW:
Tested-by: Steve Capper <steve.capper@linaro.org>

Cheers,
-- 
Steve

> 
> 
> -- 
> Kees Cook
> Chrome OS Security
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v3] ARM: mm: report both sections from PMD
@ 2014-02-14 17:05   ` Steve Capper
  0 siblings, 0 replies; 12+ messages in thread
From: Steve Capper @ 2014-02-14 17:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 13, 2014 at 11:52:30AM -0800, Kees Cook wrote:
> On 2-level page table systems, the PMD has 2 section entries. Report
> these, otherwise ARM_PTDUMP will miss reporting permission changes on
> odd section boundaries.
> 
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> v3:
>  - re-reorganize, drop use of pmd_sect; suggested by Catalin Marinas.
> v2:
>  - reorganize, suggested by Catalin Marinas.
> ---
>  arch/arm/mm/dump.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm/mm/dump.c b/arch/arm/mm/dump.c
> index 2b342177f5de..61cc78ae9f21 100644
> --- a/arch/arm/mm/dump.c
> +++ b/arch/arm/mm/dump.c
> @@ -264,6 +264,9 @@ static void walk_pmd(struct pg_state *st, pud_t *pud, unsigned long start)
>  			note_page(st, addr, 3, pmd_val(*pmd));
>  		else
>  			walk_pte(st, pmd, addr);
> +
> +		if (SECTION_SIZE < PMD_SIZE && pmd_large(pmd[1]))
> +			note_page(st, addr + SECTION_SIZE, 3, pmd_val(pmd[1]));
>  	}
>  }
>  
> -- 
> 1.7.9.5

This picks up an odd megabyte aligned section on my Arndale board with
short descriptors on 3.14-rc2. Behaves as expected with long descriptors
too (does nothing).

FWIW:
Tested-by: Steve Capper <steve.capper@linaro.org>

Cheers,
-- 
Steve

> 
> 
> -- 
> Kees Cook
> Chrome OS Security
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3] ARM: mm: report both sections from PMD
  2014-02-14 10:17   ` Catalin Marinas
@ 2014-02-14 19:13     ` Kees Cook
  -1 siblings, 0 replies; 12+ messages in thread
From: Kees Cook @ 2014-02-14 19:13 UTC (permalink / raw)
  To: Catalin Marinas, Steve Capper
  Cc: linux-arm-kernel, Russell King, linux-kernel

On Fri, Feb 14, 2014 at 2:17 AM, Catalin Marinas
<catalin.marinas@arm.com> wrote:
> On Thu, Feb 13, 2014 at 07:52:30PM +0000, Kees Cook wrote:
>> On 2-level page table systems, the PMD has 2 section entries. Report
>> these, otherwise ARM_PTDUMP will miss reporting permission changes on
>> odd section boundaries.
>>
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>

On Fri, Feb 14, 2014 at 9:05 AM, Steve Capper <steve.capper@linaro.org> wrote:
> Tested-by: Steve Capper <steve.capper@linaro.org>

Thanks to both of you! If you have a moment can you check this other
patch which has additional fixes for the dump code?

https://lkml.org/lkml/2014/2/12/662

Thanks,

-Kees

-- 
Kees Cook
Chrome OS Security

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

* [PATCH v3] ARM: mm: report both sections from PMD
@ 2014-02-14 19:13     ` Kees Cook
  0 siblings, 0 replies; 12+ messages in thread
From: Kees Cook @ 2014-02-14 19:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Feb 14, 2014 at 2:17 AM, Catalin Marinas
<catalin.marinas@arm.com> wrote:
> On Thu, Feb 13, 2014 at 07:52:30PM +0000, Kees Cook wrote:
>> On 2-level page table systems, the PMD has 2 section entries. Report
>> these, otherwise ARM_PTDUMP will miss reporting permission changes on
>> odd section boundaries.
>>
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>

On Fri, Feb 14, 2014 at 9:05 AM, Steve Capper <steve.capper@linaro.org> wrote:
> Tested-by: Steve Capper <steve.capper@linaro.org>

Thanks to both of you! If you have a moment can you check this other
patch which has additional fixes for the dump code?

https://lkml.org/lkml/2014/2/12/662

Thanks,

-Kees

-- 
Kees Cook
Chrome OS Security

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

* Re: [PATCH v3] ARM: mm: report both sections from PMD
  2014-02-14 19:13     ` Kees Cook
@ 2014-02-14 19:23       ` Russell King - ARM Linux
  -1 siblings, 0 replies; 12+ messages in thread
From: Russell King - ARM Linux @ 2014-02-14 19:23 UTC (permalink / raw)
  To: Kees Cook; +Cc: Catalin Marinas, Steve Capper, linux-arm-kernel, linux-kernel

On Fri, Feb 14, 2014 at 11:13:53AM -0800, Kees Cook wrote:
> On Fri, Feb 14, 2014 at 2:17 AM, Catalin Marinas
> <catalin.marinas@arm.com> wrote:
> > On Thu, Feb 13, 2014 at 07:52:30PM +0000, Kees Cook wrote:
> >> On 2-level page table systems, the PMD has 2 section entries. Report
> >> these, otherwise ARM_PTDUMP will miss reporting permission changes on
> >> odd section boundaries.
> >>
> >> Signed-off-by: Kees Cook <keescook@chromium.org>
> >
> > Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> 
> On Fri, Feb 14, 2014 at 9:05 AM, Steve Capper <steve.capper@linaro.org> wrote:
> > Tested-by: Steve Capper <steve.capper@linaro.org>
> 
> Thanks to both of you! If you have a moment can you check this other
> patch which has additional fixes for the dump code?
> 
> https://lkml.org/lkml/2014/2/12/662

It's not that simple, because APX in section descriptors doesn't exist
on pre-v6 ARMs.  This needs to be conditional upon the CPU arch.

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".

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

* [PATCH v3] ARM: mm: report both sections from PMD
@ 2014-02-14 19:23       ` Russell King - ARM Linux
  0 siblings, 0 replies; 12+ messages in thread
From: Russell King - ARM Linux @ 2014-02-14 19:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Feb 14, 2014 at 11:13:53AM -0800, Kees Cook wrote:
> On Fri, Feb 14, 2014 at 2:17 AM, Catalin Marinas
> <catalin.marinas@arm.com> wrote:
> > On Thu, Feb 13, 2014 at 07:52:30PM +0000, Kees Cook wrote:
> >> On 2-level page table systems, the PMD has 2 section entries. Report
> >> these, otherwise ARM_PTDUMP will miss reporting permission changes on
> >> odd section boundaries.
> >>
> >> Signed-off-by: Kees Cook <keescook@chromium.org>
> >
> > Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> 
> On Fri, Feb 14, 2014 at 9:05 AM, Steve Capper <steve.capper@linaro.org> wrote:
> > Tested-by: Steve Capper <steve.capper@linaro.org>
> 
> Thanks to both of you! If you have a moment can you check this other
> patch which has additional fixes for the dump code?
> 
> https://lkml.org/lkml/2014/2/12/662

It's not that simple, because APX in section descriptors doesn't exist
on pre-v6 ARMs.  This needs to be conditional upon the CPU arch.

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".

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

* Re: [PATCH v3] ARM: mm: report both sections from PMD
  2014-02-14 19:23       ` Russell King - ARM Linux
@ 2014-02-14 19:31         ` Kees Cook
  -1 siblings, 0 replies; 12+ messages in thread
From: Kees Cook @ 2014-02-14 19:31 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Catalin Marinas, Steve Capper, linux-arm-kernel, linux-kernel

On Fri, Feb 14, 2014 at 11:23 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
>> https://lkml.org/lkml/2014/2/12/662
>
> It's not that simple, because APX in section descriptors doesn't exist
> on pre-v6 ARMs.  This needs to be conditional upon the CPU arch.

Ah! Okay, do we need a single #define to describe the expected masks
and values? What should it look like for pre-v6 ARMs?

-Kees

-- 
Kees Cook
Chrome OS Security

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

* [PATCH v3] ARM: mm: report both sections from PMD
@ 2014-02-14 19:31         ` Kees Cook
  0 siblings, 0 replies; 12+ messages in thread
From: Kees Cook @ 2014-02-14 19:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Feb 14, 2014 at 11:23 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
>> https://lkml.org/lkml/2014/2/12/662
>
> It's not that simple, because APX in section descriptors doesn't exist
> on pre-v6 ARMs.  This needs to be conditional upon the CPU arch.

Ah! Okay, do we need a single #define to describe the expected masks
and values? What should it look like for pre-v6 ARMs?

-Kees

-- 
Kees Cook
Chrome OS Security

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

end of thread, other threads:[~2014-02-14 19:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-13 19:52 [PATCH v3] ARM: mm: report both sections from PMD Kees Cook
2014-02-13 19:52 ` Kees Cook
2014-02-14 10:17 ` Catalin Marinas
2014-02-14 10:17   ` Catalin Marinas
2014-02-14 19:13   ` Kees Cook
2014-02-14 19:13     ` Kees Cook
2014-02-14 19:23     ` Russell King - ARM Linux
2014-02-14 19:23       ` Russell King - ARM Linux
2014-02-14 19:31       ` Kees Cook
2014-02-14 19:31         ` Kees Cook
2014-02-14 17:05 ` Steve Capper
2014-02-14 17:05   ` Steve Capper

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.