From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796286576; b=IM6N50jT8lDJLVDfqhmQaWrQkLFEONuv4DROfuS8A3zMCmmjpclR11P50fC5A+GA1oqw 10kn2vtboSos7rUAfFVXzuUgglv1gBuIsrb3j8sLj0Wrnwij6219TUKOSJtG1Qu7liRzt VzccJ/KK0OOsPJK5/BRIij2ezaKHw1PD2G70EsnlqPGp+DVlox6uU79uSGmKraG/C+3g5 a7fH7+hZlkisc1UKU7TFCFDhLBeMtr9fdS1LlzR4U+ndpR+hHl9LYrS6v61euMMF4YfiL p3fHausyrCRalm6PsQgrxTWeyov0tkgPd7HPQU/lk6vRbxHgQOoh01MgnDjls+k9KtQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796286576; h=Received:DKIM-Signature:From:To:Cc:In-Reply-To:References:Subject: Message-Id:Date:MIME-Version:Content-Type:Content-Transfer-Encoding: X-Mailer; bh=LQCmieAlRot9LmGpeTfd/TIuOgEPDmQ4EZvMbFyOdoQ=; b=LcWXH4o1lNpcOwrrJpnf+OdBa1YLw424B2JLfm23KatFoz3DKGHwPn+tY1qqmIY1/nlb jUo7/dmvQUx3rmcN/dM8DAYuUW2/AypXPF8TP5zlBbzBd1yHW8pf0LXtmmnFnFIXnhL1s By63OIHRebP1fMRWlZcggQu0u8JrUKNhxSWTf6g6sljUfUkDqceNHmvn6OiIu9LUX1CdV uG4Ir+HN/U6GRijajvFfqDn79zsjZ6e0fbe2BvJrDbYhSgos76AHhZG07ECirG2WCAM/1 sxi1pmrHJ6wqNPEcLVZm8ZjhKKAZBMoLxW5h8CNrwxUMqrOtxvwQ53KqAKXz13h7WEA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jU5S9fGY; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69D2C606A332; Thu, 3 Dec 2026 08:29:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jU5S9fGY Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AF851F00896; Thu, 3 Dec 2026 08:29:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796286575; bh=LQCmieAlRot9LmGpeTfd/TIuOgEPDmQ4EZvMbFyOdoQ=; h=From:To:Cc:In-Reply-To:References:Subject:Date; b=jU5S9fGY1oe3MAIhe5rbbp1VIzZ0r9vI0pNozIXUXBwnMGf12wFOJmkxlRjnnDno6 Bj1BcXvx4HDpkJ3PtrN41ZrCjC0T8BSG10j0uwb9cqc1IaqFM7ylPpLAQFoL7xILfU wvjvu8UidORJFnJNCcnU+9K0Lf+/ypJ7lsdn6Ra8iPI1QXJN+X1yZSubo62DRG++YE jmpHp4+M1w4n7KGQYgENugR8kGUZ3ilxABTXwZAG51yVK83ycOHGrbvyupMbDmOksf TNpH/+EKgIb9+go3XAd4U9ovyrjhtEsVZ+P0ei+dwnBdiowU48lpfQuqpIyHOKzLy9 mxxf+HYmcv/eg== From: David Hildenbrand To: David Hildenbrand , Zi Yan , Andrew Morton , Elkin Cruz Cc: Baolin Wang , "Liam R. Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Kiryl Shutsemau , linux-mm@kvack.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, irogers@google.com In-Reply-To: <20261202200056.3555477-1-elkin@google.com> References: <20261202200056.3555477-1-elkin@google.com> Subject: Re: [PATCH v2] mm/huge_memory: check VMA end bounds in insert_pmd() and insert_pud() Message-Id: <179628657181.3584.3078051459903025522.b4-ty@b4> Date: Thu, 03 Dec 2026 09:29:31 +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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: b4 0.16.0 On Wed, 02 Dec 2026 20:00:56 +0000, Elkin Cruz wrote: > insert_pmd() and insert_pud() currently check only that addr lies within > [vma->vm_start, vma->vm_end), without verifying that the full PMD or PUD > mapping fits below vma->vm_end. > > All current in-tree callers already validate VMA end alignment/bounds, > so no existing user triggers this. Harden both helpers defensively by > requiring addr + HPAGE_PMD_SIZE <= vma->vm_end in insert_pmd() and > addr + HPAGE_PUD_SIZE <= vma->vm_end in insert_pud(). > > [...] Applied, thanks! tree: mm/core.git branch: thp-7.5.misc Applied patches will appear soon in mm-next, followed by linux-next. Please report any outstanding bugs that were missed during review, so we can either drop the patch series or decide how to fix it up. It is encouraged to provide Acked-bys, Reviewed-bys, and Tested-bys even though the patches have already been applied. If possible, patch trailers will be updated. Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. Further, this is not a guarantee that the patches will go upstream. If in doubt, please check the listed branch. [1/1] mm/huge_memory: check VMA end bounds in insert_pmd() and insert_pud() https://git.kernel.org/mm/core/c/814f1a29 -- Cheers, David