From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) (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 716121C5799 for ; Mon, 6 Jul 2026 02:18:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.185 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783304298; cv=none; b=TC3jLkrc2XjPjymviFDNpme/j9WO5P+IXMWkI3hRhfEg4WoFICtsKXSHa4K0o8YzcReOi9U4iqLl5kEWjrDhHf1GSlgc3coYrt0x5qWa1s7NklbiVdRag53zkKQIN3jRfd0WMYcuudP7CBGM+1xQtgvTAv08ku7EZ8kqj5Oxrx0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783304298; c=relaxed/simple; bh=PjQVgecKJOZGFxT3Jl+PqjgJsSRORMdrB+qNmDIVxzk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jJnykUeiWkjHbMlZ+W6g4M3VhaGt8X6gn2JSUVb/9opWv61y4InAwsMnfPaEahe5vRT9Lc0FdqXKjBu5308a6QfCagnIx8uOcrv1zc5jLVOAyZlO4v1EUmmChhUOzhcy89exyulk9tD5cO9lvtrc/gZI3/alyeZ4GCPlf5zyh4M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=cTLy58j1; arc=none smtp.client-ip=91.218.175.185 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="cTLy58j1" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1783304294; 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=LNM4IcxFKNqiDM5ljWFmkAzvvwWKz3AlHXSb+fCuWM8=; b=cTLy58j1EvgFx5vcjFvTMGe0Af738rRAdqG5mFMbavAEG+KGEZx7UB5r1NDq5x64hfV/pY Wx8Y956AY9DFRZDeK2F81DpjnG3TlNH9xeHKxaKXUOTmElUspPtFeK77QUnPurG5SphNGp ZB79MAuvfm1MqXKxJDv+peE7szuKY10= Date: Mon, 6 Jul 2026 10:18:00 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH] userfaultfd: wait on source PMD during UFFDIO_MOVE Content-Language: en-US To: Usama Arif Cc: aarcange@redhat.com, ziy@nvidia.com, david@kernel.org, baolin.wang@linux.alibaba.com, baohua@kernel.org, ryan.roberts@arm.com, npache@redhat.com, ljs@kernel.org, dev.jain@arm.com, linux-mm@kvack.org, sashiko-bot , Andrew Morton , linux-kernel@vger.kernel.org, kernel-team@meta.com, hannes@cmpxchg.org, shakeel.butt@linux.dev, riel@surriel.com, liam@infradead.org References: <20260705131231.1499198-1-usama.arif@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Lance Yang In-Reply-To: <20260705131231.1499198-1-usama.arif@linux.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 2026/7/5 21:12, Usama Arif wrote: > move_pages_huge_pmd() snapshots src_pmdval under src_ptl, drops the lock, > and, for migration entries, waits with pmd_migration_entry_wait(). > > Passing &src_pmdval is wrong. pmd_migration_entry_wait() must lock and > re-read the real page-table PMD; on split-PMD-lock kernels, a stack > address also resolves to the wrong lock. softleaf_entry_wait_on_locked() Well spotted! > then waits without a folio reference, which is safe only while serialized > against migration-entry removal by the real PT lock. > > Pass src_pmd, matching __handle_mm_fault() and hmm_vma_walk_pmd(). > > Reported-by: sashiko-bot > Link: https://sashiko.dev/#/patchset/20260703173903.3789516-1-usama.arif%40linux.dev?part=8 > Fixes: adef440691ba ("userfaultfd: UFFDIO_MOVE uABI") > Signed-off-by: Usama Arif > --- As Andrew and Baolin pointed out, this should go to stable ;) With that, Reviewed-by: Lance Yang