From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EEF8C2BA83 for ; Thu, 13 Feb 2020 12:14:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 92AD82073C for ; Thu, 13 Feb 2020 12:14:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="WN9pWgky" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92AD82073C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DEE1E6B0534; Thu, 13 Feb 2020 07:13:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D9DC06B0535; Thu, 13 Feb 2020 07:13:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C8C376B0536; Thu, 13 Feb 2020 07:13:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0218.hostedemail.com [216.40.44.218]) by kanga.kvack.org (Postfix) with ESMTP id AE2CE6B0534 for ; Thu, 13 Feb 2020 07:13:59 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 37BA48248047 for ; Thu, 13 Feb 2020 12:13:59 +0000 (UTC) X-FDA: 76484995398.11.men80_5a31bf578b4e X-HE-Tag: men80_5a31bf578b4e X-Filterd-Recvd-Size: 4409 Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Thu, 13 Feb 2020 12:13:58 +0000 (UTC) Received: by mail-lj1-f175.google.com with SMTP id d10so6313497ljl.9 for ; Thu, 13 Feb 2020 04:13:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=XLeDrrNh+v2Nw1/rN8+tIVxY0qt2GdiR+9WKHNleP/w=; b=WN9pWgkyQlhiezhVOXCvU6X7mqtwlF2QT7QQ+zYSVbZgVX+Ta6KbHPGobQU7u2SPox 2PR68sNvkFC2oijLnXIsjB3iwhWXt442AlKELgTc/HPJqO0DOwz1gupWT3tBMtANLnM9 1C7JxjCjfruDHwTbioI0W312iULuOmaEIZc67gt+8SxJ/plV+SYbMg2m1IPPBrcWs8kW 0cyRU4CIerXBIywn0fvZiPogXmgQii+lXSv8b1EUlZ4lm0R+EceZifGe+hjPoziB+Gh5 EYQs3hElytgfwDoX9fF7dmHPFsMf5fodyIv48a7eqDozB/crAZkmL6xK58k+B4XxvutY 6mJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=XLeDrrNh+v2Nw1/rN8+tIVxY0qt2GdiR+9WKHNleP/w=; b=cHugLtGaP24lDVSt238mxi2IfFAl6QL8SCv/xIpPAr/WE7a3qWti67jNV7to6TrkvK ZTRa6iqvT5a8NRyLN/W9FU2VS9fdU0KOcp55EfW7LJbbbXtdlqAAb2eGiBqMfIixgC5n OdDmSpt3zhH7USJQM4Y5f8VLsI9mmAkoAr35IgPLQ1ZBba1NbEg96ms9P2Eo8gK/PxaU owmXjBzH3o3/jc565hetETwfBYazEVmavyjIagI2YjhhNu1K+EErAPeqKrtgYbOPPfz1 Xuari+7o5lof6DtqoJKonqxLrChtmyALZ224ZvGfFGtPSWa9O02Ixp91rxwTc0QC6Uf4 e9Yw== X-Gm-Message-State: APjAAAX+FAW9N96Ko0voqVagcRvCcMAszp7sed5OSpL191IwZVx0lPAw Vs1KG3rcLuSikTHjU9MYIZOSJA== X-Google-Smtp-Source: APXvYqycnY1gNYIgU7PZLCEgZ/5PPlZQkh1ImZxxJTr2tfqpA9myhcs+ddErJwDoottyh1ISVy6OzQ== X-Received: by 2002:a2e:90c6:: with SMTP id o6mr10965458ljg.129.1581596037315; Thu, 13 Feb 2020 04:13:57 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id t27sm1327116ljd.26.2020.02.13.04.13.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2020 04:13:56 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id 03BA9100F24; Thu, 13 Feb 2020 15:14:16 +0300 (+03) Date: Thu, 13 Feb 2020 15:14:16 +0300 From: "Kirill A. Shutemov" To: Jeff Moyer Cc: Jia He , Catalin Marinas , "Kirill A. Shutemov" , linux-mm@kvack.org Subject: Re: bug: data corruption introduced by commit 83d116c53058 ("mm: fix double page fault on arm64 if PTE_AF is cleared") Message-ID: <20200213121416.57ddim2ygktctjrl@box> References: <20200211145158.5wt7nepe3flx25bj@box> <20200211224038.4u6au5jwki7lofpq@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Feb 12, 2020 at 09:22:03AM -0500, Jeff Moyer wrote: > "Kirill A. Shutemov" writes: > > > On Tue, Feb 11, 2020 at 11:27:36AM -0500, Jeff Moyer wrote: > >> > The real solution would be to retry __copy_from_user_inatomic() under ptl > >> > if the first attempt fails. I expect it to be ugly. > >> > >> So long as it's correct. :) > > > > The first attempt on the real solution is below. > > > > Yeah, this is ugly. Any suggestion on clearing up this mess is welcome. > > > > Jeff, could you give it a try? > > Yes, that patch appears to fix the problem. I wonder if we could remove > the clear_page completely, though. I'd rather see the program segfault > than operate on bad data. What do you think? It is long standing policy: see 6aab341e0a28 ("mm: re-architect the VM_UNPAGED logic") from 2005. Some obscure case may break if change it. I think it is fine to live with the WARN for a while and change it to SIGBUS once we can be relatively sure that it is okay. -- Kirill A. Shutemov