ARM: mm: report both sections from PMD
PATCH v3 1/1 ARM: mm: report both sections from PMD
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.
---
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(+)
arch/arm/mm/dump.c +3 -0
@@ -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)); elsewalk_pte (st ,pmd ,addr ); + +if (SECTION_SIZE <PMD_SIZE &&pmd_large (pmd[1 ])) +note_page (st, addr +SECTION_SIZE ,3 ,pmd_val (pmd[1 ])); } }
Signature · 6 lines
1.7.9.5 -- Kees Cook Chrome OS Security
Quoted 5 lines · Kees Cook
On 2-level page table systems, the PMD has 2 section entries. Report these, otherwise
ARM_PTDUMPwill miss reporting permission changes on odd section boundaries.Signed-off-by Kees Cook <[email protected]>
Quoted 8 lines · Catalin Marinas
Quoted 5 lines · Kees Cook
On 2-level page table systems, the PMD has 2 section entries. Report these, otherwise
ARM_PTDUMPwill miss reporting permission changes on odd section boundaries.Signed-off-by Kees Cook <[email protected]>Acked-by Catalin Marinas <[email protected]>
Quoted 1 line · Steve Capper
Tested-by Steve Capper <[email protected]>
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
Signature · 2 lines
Kees Cook Chrome OS Security
Quoted 11 lines · Kees Cook
Quoted 8 lines · Catalin Marinas
Quoted 5 lines · Kees Cook
On 2-level page table systems, the PMD has 2 section entries. Report these, otherwise
ARM_PTDUMPwill miss reporting permission changes on odd section boundaries.Signed-off-by Kees Cook <[email protected]>Acked-by Catalin Marinas <[email protected]>
Quoted 7 lines
Quoted 1 line · Steve Capper
Tested-by Steve Capper <[email protected]>Thanks to both of you! If you have a moment can you check this other patch which has additional fixes for the dump code?
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.
Signature · 3 lines
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".
Quoted 4 lines · Russell King - ARM Linux
Quoted 1 line
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
Signature · 2 lines
Kees Cook Chrome OS Security
Quoted 30 lines · Kees Cook
On 2-level page table systems, the PMD has 2 section entries. Report these, otherwise
ARM_PTDUMPwill miss reporting permission changes on odd section boundaries.Signed-off-by Kees Cook <[email protected]>---
v3:
- re-reorganize, drop use ofpmd_sect; suggested by Catalin Marinas.
v2:
- reorganize, suggested by Catalin Marinas.--- arch/arm/mm/dump.c | 3 +++ 1 file changed, 3 insertions(+)arch/arm/mm/dump.c +3
-0@@ -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)); elsewalk_pte (st ,pmd ,addr ); + +if (SECTION_SIZE <PMD_SIZE &&pmd_large (pmd[1 ])) +note_page (st, addr +SECTION_SIZE ,3 ,pmd_val (pmd[1 ])); } }Signature · 1 line
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:
Cheers,
Signature · 1 line
Steve
Quoted 10 lines
Signature · 8 lines
-- 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