Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2509806lqt; Mon, 22 Apr 2024 12:47:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUwhUeIGNHj3HCx4a84Cbv9iERWcQnA+xosWXCYc3JGd4D6f3bMgEuM2Ja85fXcpMy7FhSE7KmF+ix2hYOb7NC9NBXir7z2rNCpcdPH4A== X-Google-Smtp-Source: AGHT+IGI05QtDvQYFUFL/ijxiIG76vKBBJvlpcau8+SgYVofTfwbwHe9/BQK/iCqJ0uj+CJQooFa X-Received: by 2002:a37:e210:0:b0:78d:65bf:4208 with SMTP id g16-20020a37e210000000b0078d65bf4208mr11532659qki.27.1713815248741; Mon, 22 Apr 2024 12:47:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713815248; cv=pass; d=google.com; s=arc-20160816; b=0653VVExAwkyUD0P+JVGPVQ4CussYouZLZBQw3Py8tc9qShykifmbOCFSwuFEsfPw4 h4MVGTjmedEqfUIe8NduIjqio1sYcyZAmmzcr4OBMxzhnyVDJj+uXF3Oac83th4oCwae /2QQ1XUerGW2gM7RWrVqn2H8gKmbAjUS8D2tT34QO04xQhsGpbJiHqaJGevVFPu0ooVj SdS5xKx8eP9+SawyD1GyIFOv9JPgTK8IDvD5rJ9AFSMrjtHgWo/DYHM0upun7FxCihBg Legq/chVODz3qdPrZcToln3R6na1nPCTm42aam5jtrCFizPktTZXGOf0Ng8fgP/m+JlQ VTNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=76gu8eUjnppxduDLoTKr4Q+dTol5uZXEnc2IOhBfsLI=; fh=hhdtTHgm2rjR8cBylYCAKHG9Oii0gD3mJEZNhzIYxgQ=; b=g523hLKKA4LIwDlK9BZOeOV6ShlIFCoT8RbeypufDuRExBYksmesrHT8PZo+zFb7mh yoHqwVf7+aocxeLDKoBz35L7mCMZYZsovJTYLhzEs+6m9GdtyYJ/N9uiBNYtpotp5Oe+ WHMW6t+j3sTCoqQ8h7HLGV4nDGZ/+TqbZAEVhQ55tN5XR20D7KZiWdFNK69nFI+cWKyF pz+eJM6j8kL5WuhN/L2RXmr4L3tt3R81mu1rIGlinDPfw6HQoJozDmjr5Zi61xee87r1 +a2QgZn7XLReqmEqKJZgcFfMaWX3aY6yYjGmzydTxf6UzKXHx3zw+4NcyPTaUOIO9TSk 05LQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=Akxs0LOb; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-153939-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153939-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u13-20020a05620a084d00b0078f162257edsi9644472qku.425.2024.04.22.12.47.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 12:47:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153939-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=Akxs0LOb; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-153939-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153939-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 78A171C20A3F for ; Mon, 22 Apr 2024 19:47:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2ED3B15534E; Mon, 22 Apr 2024 19:47:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="Akxs0LOb" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FDA4153BFB for ; Mon, 22 Apr 2024 19:47:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815240; cv=none; b=HWueVhgE/SPiXYVCf9cl5UiPyEAc8Tm5qAewa1TJl8jr3tyW2xl9r/Kgv+0xW3m7vGobOhQVA6KQk9fsXm0pf+TzUo1fJfWbPC5A5MBsw1e3gJftqQZ0tRpQ7RRrbpkpg261q4vjLWIMSXCK3V2g5dUnCQr2xzmMoJRikOQVCDA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815240; c=relaxed/simple; bh=qTTNSuUYZaV5HVhMNgNjy/ynO2wqp8xqpRZXrz8vE5Q=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=hK8nF6om1hSQ4azoxk8TH5/20QwZzU+okLhlsaAQUk4SivdV4kY5u2pKPW5X/gHZQXj243UpJCWmrczYXt0AZ1CC8GXvLrX80SNpL76iGoWn0GEWwLE8tcQtkPiVfz60QyUHmEkI1wjND/nID6Cz7oMA1JfSBCq3sUsqUylrSmo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=Akxs0LOb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6DE1C113CC; Mon, 22 Apr 2024 19:47:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1713815239; bh=qTTNSuUYZaV5HVhMNgNjy/ynO2wqp8xqpRZXrz8vE5Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Akxs0LObreD8YPZWiUNU5y8ADrgheTp/brMABs0nGXP/9sHrBZFzfi2XvfiPMz2ww 7NAukUIItD1cv4JiM2iJkD/t/QzFl0vMR/i7KL7kDMRd3I1C8goNvhOH5wV2bBt4f1 3vEUt7Iu8LtGgxI9B5eiOYWqzENYkg8/mxKAAckU= Date: Mon, 22 Apr 2024 12:47:19 -0700 From: Andrew Morton To: Peter Xu Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Nadav Amit , David Hildenbrand , syzbot+d8426b591c36b21c750e@syzkaller.appspotmail.com Subject: Re: [PATCH] mm/userfaultfd: Reset ptes when close() for wr-protected ones Message-Id: <20240422124719.5097e42a736403d306ba7cf0@linux-foundation.org> In-Reply-To: <20240422133311.2987675-1-peterx@redhat.com> References: <20240422133311.2987675-1-peterx@redhat.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 22 Apr 2024 09:33:11 -0400 Peter Xu wrote: > Userfaultfd unregister includes a step to remove wr-protect bits from all > the relevant pgtable entries, but that only covered an explicit > UFFDIO_UNREGISTER ioctl, not a close() on the userfaultfd itself. Cover > that too. We should include a description of the userspace-visible effects of the bug, please. Always. I see it triggers a WARN, but so what - why ca't we simply delete the WARN statement if that's the only effect? Presumably there are other consequences - what are they? Also, a WARN-triggering bug should be fixed in -stable kernels so we'll need a FIXES:, please?