From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.54 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796472935; b=XywugqpFPpQVBtdkbPpFI/bmU/8DW19QdAlO2m9VBS8qOdQEge1uF0bD9tkeJbVjs7U/ Zi57l1WnUJuLqgZ0BEdI0n0xz5/3jg6CEQjltAWtQDzoBiJxiUJvXn2X6ZX4foWuliOUq o4d/Jhs5EWd24b11B0uI//XeqYV0rsHiQSWH1J58jiM66XHmBR2OwgUjRbkDgsqsdyDg7 ixCBNvE4Qv2CSkiPQI+5L2DRdr+P7jo/8Nawu/UKgVYAZJ+jWYQpM5sekM8PDQa++q6N/ dKRd/eMKhDJRcU9Lnl8RFf4K4ZaaBXdhg/TRh6mRDDgDQqTa1iPK3af3jKNKv/9wS9g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796472935; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:From:Subject:To:Cc:References: Content-Language:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=eLK3Bw1NzOKzIUF0h8AHZZnNbgtzT0hGeZiU/uLFLtE=; b=iU8nxfj6xE9Az6n831vpRbL0MDuzV/PJHVz62/EVSnMattm/15rRgkFy8aI4Y+YE4GYe 5jMQ5SRTK5enfSPMU2UzIKynBrBFvPtGo0nVO8C32gv1aEZ0eVfxQ+EmlADHx+0zLi2qZ HyjY7A1YSA4w2yV0avTsdm2nvA+fTkBCJhtzVzCAtq/QjM6hRy+FKsnT/gzrX/sjvSES6 dHb7bds4Mjka9l9/Pr56hl4soOtITxvESlhYCzIg6YZt7qXwuGjt3pSTWODZg3p6mrbVM QXcsuSH7xyCPvfpBBhbpq9YfdfTz5wHnZAcLXn7kaMEbol3H7L4TKdVqdZ0Exq5vb8A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=A27ZWf0g; arc=none smtp.remote-ip=209.85.128.54 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75779606A333 for ; Sat, 5 Dec 2026 12:15:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 75779606A333 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=A27ZWf0g Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4bb5b8ef642so17932805e9.1 for ; Sat, 05 Dec 2026 04:15:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796472934; x=1797077734; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:subject:from:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=eLK3Bw1NzOKzIUF0h8AHZZnNbgtzT0hGeZiU/uLFLtE=; b=A27ZWf0g8BtM216MkrTqJEUMNmk3OIY+m/bwoFa5a1LCK/eVnRmia2oXCcRs6X2h7u G68pdmy4jFxLHd/CoSPhz79KU112g7jxm969ZQH0tWEGRubjOKUg4fMwzekkBbeAjn+m M5s3uQGrlpbHOlk1eiXjSY/AbQaboMTjfAP+u/y+OThU9X2SXvT1LweKit7R8heLE8PD 2xnbtrWf2qvZoiuzx5ZEZo20OWdhWJqIBzs8zj+FyXZ2bOK86B7MdmTyKKTzzk3OMWc+ tnV5qmiis4UxETj+LAFJF4c7LfFQ2Zis791V2fIT4ZY4YHXNwXKirEE0ecjRdHqoV5yR bygA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796472934; x=1797077734; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:subject:from:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=eLK3Bw1NzOKzIUF0h8AHZZnNbgtzT0hGeZiU/uLFLtE=; b=pSnnwOBOJRXIiSGmremxGc+geaamhwel6IRi3kkQG99UgfUczM2ZLpevvkRX2BLlsP ubadsKy+fMM4BqcS0Xkw2/8BAkPwfGI2WMleBymKmtY/X1hTl0eIIx5WqFQkxu892wTl CzI4VdYE2TlPvFIgsg5AGNBXZh/3YvKZwfFXW2yUg+sZMvFsxCvIDFFAh6Q0C9i1/m8B jxlhTJfWfUxJQpqxPIsmDeDwHRtUMQiKo374ySeJHA/loI9bzYKT0h/WyA3OsXDxPaFV FVHpva0L8W01OSlYSeNaXFPAcEGS9mjAJ8WaiPK16kj6CGxhUPL5X21PE0nPKnQWp2dw ysAA== X-Forwarded-Encrypted: i=1; AL+hErHGKItxGX1vwSUU13KbxNV2jR22uibesNLKVYwemUcx4AmpQ7uimUAix/GB0TRUYzKsVsZ+//bV6rsMoWI=@vger.kernel.org X-Gm-Message-State: APuU4Z8T7DV+8uA3xaetybhC9RnRgQuKuNUOO+uuiK77q1+rS7ZvyqnU YDM93tpv4ilXyzcUqRe9lfiG7B+neYiLTT5hFuPoMLfbpfjzJxCcNE+J X-Gm-Gg: AZFdTZdzVKT9XPg9L7PCuGsaltYF4Q6Pdrbu92ngy4rCfiLEhpZjsywrRV1mANoRSU+ cg0zCV6C3stgpp1LpwKNCA3MuB/h2jea0vjc1zFXWD9CCNejFcH2XIpKBiTbWGcyxB15zdtq13n uXlB9tz2geIqerLlFtd3gk5PbI4951zLmh6z5o0iH+1saw+aZTV5RA+Ky70BV0lrBYFlrbtfo9r 0Euyf4xyzViI2qMtENVSNM1vRh48dtk5Bzt2uOJzl87h6jHoj9oE5egPgsH5F4vx0McyTshpJxP QLooGyl1Ds72ixsJYraeyqpuPKJWYRL33lvcTgkhUSQwVozC3g130zSQudmqjwnIvRlVtIBeNkx gdY5EtnKkAsGrt1q7KzmOaVuHS/s5vu/LiLk5b9QcUq81ulqUiFn0AvvxSe9FMnvEQOCYQU3061 AFqdpqsrQIbotT8LrnDbH/cBt85j/AtMVfFgcd7sLh2sNX7VGQWBcZWiauCqzLYw/k/Nc4Yhpul zjE1eArhRSY0pWzSIN744RsjtnXiNHgCX+YqJXV6KvF+jfc5CgV2kGJ4z0YG9+ysCnVMyLsvYiK txZshOt8aoaMkLNqKJBRYYMaXzeRFbKy9POBy1L7rHjrJMDMtiz2lQU= X-Received: by 2002:a05:600c:a4d:b0:4af:c210:5b3f with SMTP id 5b1f17b1804b1-4bbeb8c92b2mr93634795e9.24.1796472933602; Sat, 05 Dec 2026 04:15:33 -0800 (PST) Received: from [192.168.1.22] ([83.231.69.9]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbea29f8casm130670575e9.9.2026.12.05.04.15.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 05 Dec 2026 04:15:32 -0800 (PST) Message-ID: Date: Sat, 5 Dec 2026 13:15:29 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: "Jose A. Perez de Azpillaga" Subject: Re: [PATCH v2 35/35] mm/hugetlb: resolve protnone faults without a uffd bit To: "David Hildenbrand (Arm)" , Muchun Song , Oscar Salvador , Andrew Morton , Hongfu Li , Jinmeng Zhou , Mina Almasry , Davidlohr Bueso , Naoya Horiguchi , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Michal Hocko , Jonathan Corbet , Shuah Khan , Randy Dunlap , Vivek Kasireddy , Mel Gorman , Hugh Dickins , Baolin Wang , Dave Airlie , Jason Gunthorpe , Andy Whitcroft , Roman Gushchin , Barry Song , Andrea Arcangeli , Lorenzo Stoakes , Suren Baghdasaryan , Shakeel Butt , Pedro Falcato , Jann Horn , Guillaume Morin , Yang Shi , James Houghton , Rik van Riel , Harry Yoo , Lance Yang , Axel Rasmussen , Peter Xu , Sasha Levin , Kiryl Shutsemau , Christian Brauner , "Steven Rostedt (Google)" , Hongbo Li , Gregory Price , Zi Yan , Joshua Hahn , Rakie Kim , Ying Huang , Matthew Brost , Byungchul Park , Alistair Popple , Andi Kleen , David Rientjes , Joern Engel , "Aneesh Kumar K.V" Cc: linux-mm@kvack.org, linux-doc@vger.kernel.org, Gerd Hoffmann , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Johannes Weiner , Chris Mason , Jiaqi Yan References: <20261203-hugetlb_fixes_2-v2-0-9bbeabb555d2@kernel.org> <20261203-hugetlb_fixes_2-v2-35-9bbeabb555d2@kernel.org> Content-Language: en-US In-Reply-To: <20261203-hugetlb_fixes_2-v2-35-9bbeabb555d2@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/3/26 12:37 PM, David Hildenbrand (Arm) wrote: > From: Chris Mason > > hugetlb_fault() only restores the protection of protnone entries that > have the uffd bit set, assuming that accessible VMAs cannot have other > protnone entries. If such an entry existed nevertheless, any access to > it would result in an endless fault loop. > > We are not aware of a way to trigger this: paths that drop the uffd bit > (fork(), mremap(), unregistering) restore the protection, and > remove_migration_pte() only drops the uffd bit for writable migration > entries, which cannot be created from protnone entries. > > Let's be defensive and make any protnone entry in an accessible VMA > accessible again, unless it is an RWP fault that has to be reported to > user space, like do_numa_page() does for small folios. > > Signed-off-by: Chris Mason > [ david: adjust comments and description ] > Signed-off-by: David Hildenbrand (Arm) LGTM: Reviewed-by: Jose A. Perez de Azpillaga -- cheers, jose a. p-a