All of lore.kernel.org
 help / color / mirror / Atom feed
From: steve.capper@linaro.org (Steve Capper)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3] ARM: mm: report both sections from PMD
Date: Fri, 14 Feb 2014 17:05:59 +0000	[thread overview]
Message-ID: <20140214170558.GA13608@linaro.org> (raw)
In-Reply-To: <20140213195230.GA15275@www.outflux.net>

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

WARNING: multiple messages have this Message-ID (diff)
From: Steve Capper <steve.capper@linaro.org>
To: Kees Cook <keescook@chromium.org>
Cc: linux-arm-kernel@lists.infradead.org,
	Catalin Marinas <catalin.marinas@arm.com>,
	Russell King <linux@arm.linux.org.uk>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] ARM: mm: report both sections from PMD
Date: Fri, 14 Feb 2014 17:05:59 +0000	[thread overview]
Message-ID: <20140214170558.GA13608@linaro.org> (raw)
In-Reply-To: <20140213195230.GA15275@www.outflux.net>

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

  parent reply	other threads:[~2014-02-14 17:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2014-02-14 17:05   ` Steve Capper

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=20140214170558.GA13608@linaro.org \
    --to=steve.capper@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.