From patchwork Thu Dec 5 14:23:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jon Medhurst (Tixy)" X-Patchwork-Id: 3288721 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C05D29F37A for ; Thu, 5 Dec 2013 14:24:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 75E9D2051C for ; Thu, 5 Dec 2013 14:24:34 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD56D20515 for ; Thu, 5 Dec 2013 14:24:29 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VoZqr-0004ey-KA; Thu, 05 Dec 2013 14:24:25 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VoZqp-0002WY-8a; Thu, 05 Dec 2013 14:24:23 +0000 Received: from smarthost01b.mail.zen.net.uk ([212.23.1.3]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VoZqm-0002WG-Ex for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2013 14:24:21 +0000 Received: from [82.69.122.217] (helo=[192.168.2.110]) by smarthost01b.mail.zen.net.uk with esmtpsa (TLS1.0:DHE_RSA_CAMELLIA_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1VoZqP-000Gko-Uq; Thu, 05 Dec 2013 14:23:58 +0000 Message-ID: <1386253407.3525.8.camel@linaro1.home> Subject: Re: [GIT PULL] Cacheflush updates for 3.12 From: "Jon Medhurst (Tixy)" To: Will Deacon Date: Thu, 05 Dec 2013 14:23:27 +0000 In-Reply-To: <20131204161329.GA14145@mudshark.cambridge.arm.com> References: <20130812173155.GI25995@mudshark.cambridge.arm.com> <20131204161329.GA14145@mudshark.cambridge.arm.com> X-Mailer: Evolution 3.4.4-3 Mime-Version: 1.0 X-Originating-smarthost01b-IP: [82.69.122.217] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131205_092420_599968_210D386F X-CRM114-Status: UNSURE ( 8.77 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.2 (-) Cc: Christian Gmeiner , "linux+pull@arm.linux.org.uk" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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)... diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index dbf0923..cbc9dae 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -512,6 +512,10 @@ __do_cache_op(unsigned long start, unsigned long end) unsigned long chunk = PAGE_SIZE; do { + unsigned long chunk_end = start + chunk; + if (chunk_end > end) + chunk_end = end; + if (signal_pending(current)) { struct thread_info *ti = current_thread_info(); @@ -531,7 +535,7 @@ __do_cache_op(unsigned long start, unsigned long end) return -ERESTART_RESTARTBLOCK; } - ret = flush_cache_user_range(start, start + chunk); + ret = flush_cache_user_range(start, chunk_end); if (ret) return ret;