Message ID | 20140213195230.GA15275@www.outflux.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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 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,
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
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.
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
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])); } }
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(+)