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.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 043D2C35242 for ; Fri, 14 Feb 2020 21:07:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B2D8A217F4 for ; Fri, 14 Feb 2020 21:07:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="f+R2YAot" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B2D8A217F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4C8616B0695; Fri, 14 Feb 2020 16:07:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4789F6B0697; Fri, 14 Feb 2020 16:07:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 38E586B0698; Fri, 14 Feb 2020 16:07:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0189.hostedemail.com [216.40.44.189]) by kanga.kvack.org (Postfix) with ESMTP id 1E70B6B0695 for ; Fri, 14 Feb 2020 16:07:11 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id BA5C6181AEF1A for ; Fri, 14 Feb 2020 21:07:10 +0000 (UTC) X-FDA: 76489967820.28.bait32_3ea09bb977637 X-HE-Tag: bait32_3ea09bb977637 X-Filterd-Recvd-Size: 3984 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Fri, 14 Feb 2020 21:07:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581714429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8wWgewNLrAmVPvhfXSt13TNBMLvme6yeXRvy1gaXK6E=; b=f+R2YAotUyCC73wtKFam36iCg+0ml9hRIj78Wjc75JevVctFz1PPUlYbW0sihflrra/Oz9 kjU/SBDFyDkvrY/H41dHzk9deZ80hFVTzpvrIUA6U/ZiBuVP3Ki1ztuUIAA2Zg5owANu3s QVrKqLHJrqRh06spcQOcEdDCWhDoqyc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-301-u2M1WGJrPKm6SF7VDqQ2Ng-1; Fri, 14 Feb 2020 16:07:08 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A0DC1801E78; Fri, 14 Feb 2020 21:07:06 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 96EF019C58; Fri, 14 Feb 2020 21:07:05 +0000 (UTC) From: Jeff Moyer To: "Kirill A. Shutemov" 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") References: <20200211145158.5wt7nepe3flx25bj@box> <20200211224038.4u6au5jwki7lofpq@box> <20200213121416.57ddim2ygktctjrl@box> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 Date: Fri, 14 Feb 2020 16:07:04 -0500 In-Reply-To: <20200213121416.57ddim2ygktctjrl@box> (Kirill A. Shutemov's message of "Thu, 13 Feb 2020 15:14:16 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: u2M1WGJrPKm6SF7VDqQ2Ng-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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: "Kirill A. Shutemov" writes: > On Wed, Feb 12, 2020 at 09:22:03AM -0500, Jeff Moyer wrote: >> "Kirill A. Shutemov" writes: >>=20 >> > On Tue, Feb 11, 2020 at 11:27:36AM -0500, Jeff Moyer wrote: >> >> > The real solution would be to retry __copy_from_user_inatomic() und= er ptl >> >> > if the first attempt fails. I expect it to be ugly. >> >>=20 >> >> 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? >>=20 >> 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'll take your word for 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. OK, fine by me. Thanks for looking into this! -Jeff