From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BDBA81FC7C5 for ; Wed, 18 Feb 2026 03:44:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771386261; cv=none; b=tvagAijt0nwaVW9AlpkWIfeGFKoUDNkHtu51v5jonMC/HbA+9xGVf7DvktJU9OyCiz+jgVIN9Zv0tuCBq2DDS2fcWm2PxG6i4rgJCxgMvDP71TMvkzI5PJVedLzyWSegVwujxIN7riB0FgL2GpT3vVdozHQ6hCtjSTYyJtnPtB4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771386261; c=relaxed/simple; bh=mdEuzxMYPGwd8CNs/UMZJUUnZdwHDwlyCJsLSOvLg9U=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=TY8esPvZBCs4l4w2Mxr9GPJgl3ThN0Yrjov+n8ze8ceVu4t1E2mKmoMxpHdh5kCR2s4MR6qcdjM0d8ZnsTydwzhc1bllNXt8eou+BABpy2HEt5Qlji/EXz4pWgHfqdK6b5LgstAB2Nulu3/CBQEnAHbclxhbjpvn/2zAXHdqhio= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=chrisdown.name; spf=pass smtp.mailfrom=chrisdown.name; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.b=TbiXrP/2; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=chrisdown.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chrisdown.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.b="TbiXrP/2" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-35658757f68so2158686a91.3 for ; Tue, 17 Feb 2026 19:44:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; t=1771386259; x=1771991059; darn=vger.kernel.org; h=user-agent:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=OizJYsHUor2RnnhJFFaJDcXjClQ0nP/mCZL/njlniiQ=; b=TbiXrP/2dzTZ0ANHdiIgAmrFiYHOpZHg0V9TVaZ8hlNQSTa9aAqmAg1oRbE0pVi2/O Y19nSJ28F1DR+96d8UTDN1uV5ABsrq9lchdt2VWGSwV8bH+dMIqncFH/f9ZAQMm3JWzQ rtT50ZiC308gK+fvRG7TCBFw3FN+H9rUukmKU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771386259; x=1771991059; h=user-agent:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OizJYsHUor2RnnhJFFaJDcXjClQ0nP/mCZL/njlniiQ=; b=P6lpi6LzVv56EDPpXJPggsFUQhEPTBNwdIJXPO6bbH0tQHFtDxQ2o5jZ6h/Aizb6UR TDKZgFi04706rmnMSA3QxNSGtqe3SXqvNJ6UxoRHXzfH9QY2iyPK6wp0ztG7VRBr+3WC aQ4mpomc5bub6/HABUY7oIAiti/oMjFcbdJWj2uz+siXdjZpomuJXe8MYNW47ZPRUWYG VgeLeoB70fTmD0EbeQMn0szhrgufaz/M7dqfplVz0wpCAX+t71Ggr65gg9bvkDYiR6TX UhbYDMJ3OQmp1l4zfXzA3JyKUbJ8+I9SOFJvKNytP6IP4JD19lNtN/KDQSE0t5b3lUyI W59Q== X-Forwarded-Encrypted: i=1; AJvYcCVcwDMrhSOkadshr1SwpJojBu6c9c5EwzjAJZRq/ldUcmCV3sXF87nJtu/dx0xcfBGJIzVAy2K7AxqmQ3E=@vger.kernel.org X-Gm-Message-State: AOJu0YzQQ7NC/BtcfODgbrSWpK69vCfywPfU7qhwGWcVYtnDglJcOELG AhWECT2ToVJyLzyIFgYNbWVE4LWKbBPvv77dwy/oMx3H3qtKnaYbWsu8en+BtowiP8M= X-Gm-Gg: AZuq6aKrAIP1oIVe7+DEb9IaV3BG/1rEkgt6s3xvjTdNQC0kxyY2Ov0Ap/PmS6yOw07 tCXVqTOujNXHXYzw54TxLaoAQ2s8J8trep+ixDeaIEsVKk1k+0CXPAn8+8dfpn8dCkDOONCGVxS 6c5LYWhebeyyYefkbEomLDJDXGlWUG8Cq78of2BGMTHgRJ4mE5EhgeFl1zwfJtiup+fqp35cGzS RoyskGgte7TZhjH7fuHvS4IZ0oMomkFrjlAkjXGxEEDgvtImJewKyWq76qogEaaUwUqwx61VVU4 QaNdLK4IPPr5WA28idlKGOmSNJ7ek21WPrkHq23gTROMaE3ZBUHD7asMjX+sJ6YopXjRHNY5CnT gwiASl80+FHYfKNHzEmwhPEKd6isdfxsX37c+xo82SlQAzTtjrLmRr6/5hnpLqFyYPd0W31gTxt w6xSuuRtqTaCG0ROCIvdxf X-Received: by 2002:a17:90b:3d50:b0:354:ad98:7d1c with SMTP id 98e67ed59e1d1-35844a354c4mr11528304a91.11.1771386259008; Tue, 17 Feb 2026 19:44:19 -0800 (PST) Received: from localhost ([175.139.248.66]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35887899158sm388475a91.5.2026.02.17.19.44.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Feb 2026 19:44:17 -0800 (PST) Date: Wed, 18 Feb 2026 11:44:17 +0800 From: Chris Down To: Andrew Morton Cc: David Hildenbrand , Matthew Wilcox , kernel-team@fb.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 0/2] mm/huge_memory: fix move_pages_huge_pmd() for huge zero pages Message-ID: 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-Disposition: inline User-Agent: Mutt/2.2.15 (2b349c5e) (2025-10-02) Two fixes for the huge zero page path in move_pages_huge_pmd() (UFFDIO_MOVE). Patch 1 fixes a use of NULL folio introduced by the folio_mk_pmd() conversion in commit e3981db444a0 ("mm: add folio_mk_pmd()"). mk_huge_pmd(src_page, ...) with folio_mk_pmd(src_folio, ...) in the huge zero page branch where src_folio is explicitly NULL. With SPARSEMEM_VMEMMAP this silently produces a PMD with a bogus PFN, on other memory models it is a NULL deref. Patch 2 adds the missing pmd_mkspecial() call that was omitted when commit d82d09e48219 ("mm/huge_memory: mark PMD mappings of the huge zero folio special") marked huge zero folio PMD mappings as special. Without it, vm_normal_page_pmd() on CONFIG_ARCH_HAS_PTE_SPECIAL architectures does not recognise the moved huge zero page as special, incorrectly treating it as a normal page and corrupting its refcount. Chris Down (2): mm/huge_memory: Fix use of NULL folio in move_pages_huge_pmd() mm/huge_memory: Mark moved huge zero page PMD as special mm/huge_memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.51.2