From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.162 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793353214; b=E/+JMy3Dv7GULu8X3DFHzgPzJQ0IWjl/jDIRqyo6O8lz83QWgBxOJE/E7jwdzCTnW3QJ 2HibVsrOIgQ66fKcLLc1IFL/XUSWW7AeQcMjq/PFki+vTR36NA2408Lqoucw0AsHWk72U dhALPzoEtk9UIOXOF8qTEi9os9jbrRncoRLl8mwXxobtAy20sPyD8cEk5v0PKUpetbD6s Eti/MiCjsKMivp1b0q3FmifODVM/Ma0iXDtVABLhcUbNqrf9fyt9QzMbLApJ1B9ywyGgk aOhS3GeFyiDqajNcif29DJUQPNvEgbAqpZR5WkLnFr/8kd4NJyDwb0xx7t/WiojuyPA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793353214; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Content-Type:Mime-Version:Subject:From: In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References: To:X-Mailer; bh=GjoByvQgZF8hrJ3bMrfVpCnfunVN4IpvJDxs7mkxVe4=; b=OxatbjkpMphkB3h0julPCgIza/swbP3XFZx6pRtNUyFtjSevRh7M+hUGuopO7tsqCKFx fP1US7YNEeC5/2fgBbrWATI+V743bkqBVkkbCkQeBQpUDq1a7n2wFWtzcshZ8Kpwk/hvO 43nEvusXG7f7ianpLSV9/YqA9tH7Z6gh4Lanl5xMZcqX+KD6OcZfEWvL+C8rWxrYl7bI5 L3y4uaf3urh6dixCoKGeDoSpH0NDPks1Og42B8h160b8Y+LJPXqdSSpiqbhloPmBOZ4vT HG0kL4wnCRtbTsXN1y6D5thnCzzpb4O6hy9KdD1c+ZulJ8fsXOIG5ecHeJRQMKAslhA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=none smtp.remote-ip=91.218.175.162 Received: from mta0.migadu.com (out-162.mta0.migadu.com [91.218.175.162]) (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 37144606A32C for ; Fri, 30 Oct 2026 09:40:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 37144606A32C 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 X-Envelope-To: linux-arch@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=GjoByvQgZF8hrJ3bMrfVpCnfunVN4IpvJDxs7mkxVe4=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1793353201; v=1; x=1793958001; b=qZexjLA3z72ct6BDu7Dc0m9BncpgG3hK4j1b3DwD3NTBjBZ20OkGtqQCD+B6oCyJi38c8XHe 9b2RX+szEZRshADVCh8gg+NONUQycTdJN52pAqQDMvLEgbE702NFZ3cLusXxVA4wy+dTS9SAuUR yzwDlzgYu4KRlYFifvWrzh7g= X-Envelope-To: linux-arch@vger.kernel.org Received: by mta10.migadu.com with ESMTPS id 391089da5ea8dc07; Fri, 30 Oct 2026 09:40:00 +0000 X-Mizu-Trace-ID: 391089da5ea8dc07 X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset=us-ascii X-Mailing-List: linux-arch@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3901.100.1.1.12\)) Subject: Re: [PATCH 07/15] hugetlbfs: fix unmapping folios from private VMAs From: Muchun Song In-Reply-To: <20261028-fixes_hugetlb-v1-7-a0a033db180f@kernel.org> Date: Fri, 30 Oct 2026 17:39:38 +0800 Cc: Oscar Salvador , Naoya Horiguchi , Andrew Morton , Mel Gorman , Andy Whitcroft , Miaohe Lin , Michal Hocko , Rik van Riel , Hugh Dickins , Baolin Wang , Vivek Kasireddy , Dave Airlie , Jason Gunthorpe , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Jonathan Corbet , Shuah Khan , Randy Dunlap , Peter Xu , Breno Leitao , Will Deacon , "Aneesh Kumar K.V" , Nick Piggin , Peter Zijlstra , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Arnd Bergmann , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Gerd Hoffmann , linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Josef Bacik , stable@kernel.org, Daehyeon Ko <4ncienth@gmail.com> Content-Transfer-Encoding: quoted-printable Message-Id: References: <20261028-fixes_hugetlb-v1-0-a0a033db180f@kernel.org> <20261028-fixes_hugetlb-v1-7-a0a033db180f@kernel.org> To: "David Hildenbrand (Arm)" X-Mailer: Apple Mail (2.3901.100.1.1.12) > On Oct 29, 2026, at 04:13, David Hildenbrand (Arm) = wrote: >=20 > From: Josef Bacik >=20 > hugetlb_unmap_file_folio() assumes vm_private_data points to a struct > hugetlb_vma_lock when hugetlb_vma_trylock_write() fails. Since hugetlb = VMA > locking was extended to private VMAs, this can also happen when > vm_private_data contains a resv_map pointer; treating it as a > hugetlb_vma_lock corrupts memory and can cause crashes or hangs. >=20 > Only take the VMA lock when a shareable lock exists, as additional = locking > is only needed for PMD table sharing. The fault mutex and i_mmap_rwsem > already provide the required protection for private VMAs. >=20 > Fix generated by an LLM and sent by Josef Bacik in private. >=20 > Fixes: bf4916922c60 ("hugetlbfs: extend hugetlb_vma_lock to private = VMAs") > Cc: stable@kernel.org > Tested-by: Daehyeon Ko <4ncienth@gmail.com> > Signed-off-by: Josef Bacik > [ david: simplify description and comment ] > Signed-off-by: David Hildenbrand (Arm) Acked-by: Muchun Song Thanks.