linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [GIT PULL] Cacheflush updates for 3.12
Date: Fri, 6 Dec 2013 11:50:15 +0000	[thread overview]
Message-ID: <20131206115015.GE16079@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <1386256471.3525.13.camel@linaro1.home>

Hi guys,

I was out-of-office yesterday, so sorry for the radio silence.

On Thu, Dec 05, 2013 at 03:14:31PM +0000, Jon Medhurst (Tixy) wrote:
> On Thu, 2013-12-05 at 14:23 +0000, Jon Medhurst (Tixy) wrote:
> > On Wed, 2013-12-04 at 16:13 +0000, Will Deacon wrote:
> > > took another look at that patch and can't see anything obviously wrong
> > > with it. 
> > 
> > If the memory region isn't guaranteed to be page aligned then doesn't it
> > flush up to PAGE_SIZE-1 more bytes than requested and so exceed the
> > bounds check in do_cache_op? Fixing this as below _appears_ to stop the
> > Browser crashes I'm seeing (still doing some more testing)...

Well spotted! We used to round down to a page, but I fixed that in the same
series and didn't notice I'd introduce a bug here. Thanks for digging.

Interesting that we've not heard more reports of this...

> Actually, a smaller patch and one which avoids the possibility of
> arithmetic owerflow is... 
> 
> From: Jon Medhurst <tixy@linaro.org>
> Date: Thu, 5 Dec 2013 14:29:24 +0000
> Subject: [PATCH] ARM: cacheflush: correctly limit range of memory region
>  being flushed
> 
> The __do_cache_op function operates with a 'chunk' size of one page
> but fails to limit the size of the final chunk so as to not exceed
> the specified memory region. Fix this.
> 
> Signed-off-by: Jon Medhurst <tixy@linaro.org>
> ---
>  arch/arm/kernel/traps.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
> index dbf0923..7940241 100644
> --- a/arch/arm/kernel/traps.c
> +++ b/arch/arm/kernel/traps.c
> @@ -509,9 +509,10 @@ static inline int
>  __do_cache_op(unsigned long start, unsigned long end)
>  {
>  	int ret;
> -	unsigned long chunk = PAGE_SIZE;
>  
>  	do {
> +		unsigned long chunk = min(PAGE_SIZE, end - start);
> +
>  		if (signal_pending(current)) {
>  			struct thread_info *ti = current_thread_info();

  Acked-by: Will Deacon <will.deacon@arm.com>

Please can you put this into the patch system, along with a CC stable?

Cheers,

Will

      parent reply	other threads:[~2013-12-06 11:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-12 17:31 [GIT PULL] Cacheflush updates for 3.12 Will Deacon
2013-12-04 15:37 ` Christian Gmeiner
2013-12-04 16:13   ` Will Deacon
2013-12-05  9:55     ` Jon Medhurst (Tixy)
2013-12-05 14:23     ` Jon Medhurst (Tixy)
2013-12-05 15:14       ` Jon Medhurst (Tixy)
2013-12-05 17:16         ` Christian Gmeiner
2013-12-06  8:05           ` Christian Gmeiner
2013-12-06 11:50         ` Will Deacon [this message]

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=20131206115015.GE16079@mudshark.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).