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=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 1832EC433E0 for ; Mon, 21 Dec 2020 18:04:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A3B0F22C9C for ; Mon, 21 Dec 2020 18:04:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A3B0F22C9C 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 F0E7E6B005C; Mon, 21 Dec 2020 13:04:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E991E6B005D; Mon, 21 Dec 2020 13:04:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D5F9F6B0068; Mon, 21 Dec 2020 13:04:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0023.hostedemail.com [216.40.44.23]) by kanga.kvack.org (Postfix) with ESMTP id BD2686B005C for ; Mon, 21 Dec 2020 13:04:20 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 85A098249980 for ; Mon, 21 Dec 2020 18:04:20 +0000 (UTC) X-FDA: 77618063880.27.self81_2e1786d27459 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 5E1113D669 for ; Mon, 21 Dec 2020 18:04:20 +0000 (UTC) X-HE-Tag: self81_2e1786d27459 X-Filterd-Recvd-Size: 3496 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Mon, 21 Dec 2020 18:04:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608573859; 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: in-reply-to:in-reply-to:references:references; bh=6sjtlrhGUxO16NzG5DkLPHVO+T8orGHfRBW16dyzHT4=; b=PHP4NUNu8xk45NuBmthW8VVe+dE/7FxtdXaiRZn8AG0QBDycRnFOzxpm3cExmCZ6gCNiSa yl7cF//rYR2l9jKUeVfrxW6gAd4ULdQCl56Pin1Po5nEmWlOcHdLAmMyoVZesoJgMZeyFK zhUJK1YPvBQs2JC4X7vWBZM5hJ5QhwM= 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-184-vMu3G7ZzMYmvWk1oEPPh9A-1; Mon, 21 Dec 2020 13:04:14 -0500 X-MC-Unique: vMu3G7ZzMYmvWk1oEPPh9A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B32A06D24B; Mon, 21 Dec 2020 18:04:01 +0000 (UTC) Received: from mail (ovpn-112-5.rdu2.redhat.com [10.10.112.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C9041E5; Mon, 21 Dec 2020 18:03:58 +0000 (UTC) Date: Mon, 21 Dec 2020 13:03:57 -0500 From: Andrea Arcangeli To: Andy Lutomirski Cc: Nadav Amit , Dave Hansen , linux-mm , Peter Xu , lkml , Pavel Emelyanov , Mike Kravetz , Mike Rapoport , stable , Minchan Kim , Yu Zhao , Will Deacon , Peter Zijlstra Subject: Re: [PATCH] mm/userfaultfd: fix memory corruption due to writeprotect Message-ID: References: <20201219043006.2206347-1-namit@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0.3 (2020-12-04) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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: Hello, On Sat, Dec 19, 2020 at 09:08:55PM -0800, Andy Lutomirski wrote: > On Sat, Dec 19, 2020 at 6:49 PM Andrea Arcangeli wrote: > > The ptes are changed always with the PT lock, in fact there's no > > problem with the PTE updates. The only difference with mprotect > > runtime is that the mmap_lock is taken for reading. And the effect > > contested for this change doesn't affect the PTE, but supposedly the > > tlb flushing deferral. > > Can you point me at where the lock ends up being taken in this path? pte_offset_map_lock in change_pte_range, as in mprotect, no difference. As I suspected on my follow up, the bug described wasn't there, but I'll look at the new theory posted. Thanks, Andrea