Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp341045img; Tue, 26 Feb 2019 00:41:24 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia+uJFiQG7y23M4gIqirPVELjmijL4OflddTMqfhAXOL7N3a9EQqNxCIqDVeLxDaZ0ARDEc X-Received: by 2002:a62:560f:: with SMTP id k15mr24552705pfb.231.1551170484702; Tue, 26 Feb 2019 00:41:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551170484; cv=none; d=google.com; s=arc-20160816; b=OBXTqJZtGM56D7xJ6rTHDVXUYsLeHfqyGwVBx4fsYcDVpQutq0E12OkTbFingg38Fh kxI2DfIZ5DKJIN4VvIgfsFmmy6GyXCprhtP9Pe4+hc1xw/iT0uXHm/SyQF75a1kXZrFm puboU98DBoOnW/8BlZ4yiJCa//DxqVpPdWgZo4roX9pFEz9bNn6nZb6eYXySt9Timpir vcIofEmzuqbvhcbKKxGDUBZGXS/C3TUpM2DpAhMK8wl+CT0ut27cG8AqCjVq4yuG9/TI KLKmQagYNbAhYRKDWykZRPaX93ZoO2+yAfpNigrFOthPk3D/BWSrveGOSvq0pAfpAziN K/dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=bTHWu/kC06ZN3NlbrciXaxQEcXqgdu17tqMpiGLkGF4=; b=tSa1YD6t6xDCup5J2ecU1p6oeivszIAAnypLvQ4KWP7rpzSjyW6rq4CrnSegcoFnhH iBiIDrzXPNI+cN2A6Q884IGm6QbIWpoVaTqK+ZYA6i5B0Zb1yYzOzwB3YAk2ltJlxw39 GcsZItilg9CV7y551PoFmIkT44B+sY+3pw2SBfHxJbrDonH2CVMK0DwvhGsZ0D1MKpmj 3VoAsoXS+S+e8UbOVoqjUSLmCtPNe8bzqGilaNxJCyZ7biKJBpNl4TuNF5NNYSIYRrci RFjSjVMWW1rbJLftTTRC/Rdzo0dZDCeib6ZOVYqwa4G059AW8X5fgvLuyoVs4+zib+ZY 9Ekg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si12106832pld.197.2019.02.26.00.41.10; Tue, 26 Feb 2019 00:41:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726954AbfBZIki (ORCPT + 99 others); Tue, 26 Feb 2019 03:40:38 -0500 Received: from bastet.se.axis.com ([195.60.68.11]:37794 "EHLO bastet.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725879AbfBZIki (ORCPT ); Tue, 26 Feb 2019 03:40:38 -0500 Received: from localhost (localhost [127.0.0.1]) by bastet.se.axis.com (Postfix) with ESMTP id C57BF184A3; Tue, 26 Feb 2019 09:40:35 +0100 (CET) X-Axis-User: NO X-Axis-NonUser: YES X-Virus-Scanned: Debian amavisd-new at bastet.se.axis.com Received: from bastet.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bastet.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id YPknBDMvn3gz; Tue, 26 Feb 2019 09:40:35 +0100 (CET) Received: from boulder02.se.axis.com (boulder02.se.axis.com [10.0.8.16]) by bastet.se.axis.com (Postfix) with ESMTPS id F2B6518470; Tue, 26 Feb 2019 09:40:34 +0100 (CET) Received: from boulder02.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C60061A07C; Tue, 26 Feb 2019 09:40:34 +0100 (CET) Received: from boulder02.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BAD2E1A07B; Tue, 26 Feb 2019 09:40:34 +0100 (CET) Received: from thoth.se.axis.com (unknown [10.0.2.173]) by boulder02.se.axis.com (Postfix) with ESMTP; Tue, 26 Feb 2019 09:40:34 +0100 (CET) Received: from XBOX04.axis.com (xbox04.axis.com [10.0.5.18]) by thoth.se.axis.com (Postfix) with ESMTP id AE73722F; Tue, 26 Feb 2019 09:40:34 +0100 (CET) Received: from [10.88.41.2] (10.0.5.60) by XBOX04.axis.com (10.0.5.18) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Tue, 26 Feb 2019 09:40:34 +0100 Subject: Re: [PATCH] mm: migrate: add missing flush_dcache_page for non-mapped page migrate To: Vlastimil Babka , Lars Persson , , CC: References: <20190219123212.29838-1-larper@axis.com> <65ed6463-b61f-81ff-4fcc-27f4071a28da@suse.cz> From: Lars Persson Message-ID: Date: Tue, 26 Feb 2019 09:40:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <65ed6463-b61f-81ff-4fcc-27f4071a28da@suse.cz> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: sv Content-Transfer-Encoding: 7bit X-ClientProxiedBy: XBOX03.axis.com (10.0.5.17) To XBOX04.axis.com (10.0.5.18) X-TM-AS-GCONF: 00 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/25/19 4:07 PM, Vlastimil Babka wrote: > On 2/19/19 1:32 PM, Lars Persson wrote: >> Our MIPS 1004Kc SoCs were seeing random userspace crashes with SIGILL >> and SIGSEGV that could not be traced back to a userspace code >> bug. They had all the magic signs of an I/D cache coherency issue. >> >> Now recently we noticed that the /proc/sys/vm/compact_memory interface >> was quite efficient at provoking this class of userspace crashes. >> >> Studying the code in mm/migrate.c there is a distinction made between >> migrating a page that is mapped at the instant of migration and one >> that is not mapped. Our problem turned out to be the non-mapped pages. >> >> For the non-mapped page the code performs a copy of the page content >> and all relevant meta-data of the page without doing the required >> D-cache maintenance. This leaves dirty data in the D-cache of the CPU >> and on the 1004K cores this data is not visible to the I-cache. A >> subsequent page-fault that triggers a mapping of the page will happily >> serve the process with potentially stale code. >> >> What about ARM then, this bug should have seen greater exposure? Well >> ARM became immune to this flaw back in 2010, see commit c01778001a4f >> ("ARM: 6379/1: Assume new page cache pages have dirty D-cache"). >> >> My proposed fix moves the D-cache maintenance inside move_to_new_page >> to make it common for both cases. >> >> Signed-off-by: Lars Persson > > What about CC stable and a Fixes tag, would it be applicable here? > Yes this is candidate for stable so let's add: Cc: I do not find a good candidate for a Fixes tag.