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=1796065725; b=tqoDN6/2Uy6dYX4U9Db9gfwz2RGt4FZbkbWWrNC1DpFqGYjJQeTjFT0hbKaM4Bxlt5r3 dKSOQDJpuNnnovygq8JRoslrJSFkBo57yXnBsdTJUVFNxEPWZpVrv6XcBGT7C/K27/dGf mF/g0U3IxtHgpv8XcBgzPYAbCqRNY882yWZM8bxpUBtpaXGzI6Hut/UvzFTCjbabiBXQE 2I0oiD0pIdsQwIyYypijwxtU88PsON6cTT6wa0ruRtCkX0scGkpKj5rlHqS6jM+N694lW 28PIQr8pGOIKPlRNYFQ8W1mazygim1cpMi77k1OTmS88bbPhadHfC6QVHuceD7xJ8bQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796065725; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=Fm4IcTTdyjuxJaTyB3zRFIJvg5nwpEmJwLlA0K8itEM=; b=OL86/dznW4AiM5sDSU5lF57Cocz3KaK9IGc25TI++8WE4ENQbJ2RORpkjph81FV+9bUV ES/+/g1S5fZS4SSXWHwhkcwyO8eII6xzl5KNOrmvgLpsLbWrnxPZkjI+QLB/JtEoZu8Qo FBWok8CHM7RPon5Q3dVGmKH+t0a4ECu4+dWmmI67H+ADYeMjK2/xro2+k3W0y2vOsJE+Z AOGH8hGdSoQhf/poRz0fVyVCv+32psE3hv01ijEoCrcRv9FV+mrYDeOQP37moA4g2E17Z FyVr/MCb1IgqthmGfe16sx5tLky6fHCLD9LdjJjmMO+53u5lASwpUsgBBnkZnSdg3aA== 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=IbCHwUjh; 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 486DC606A31C for ; Mon, 30 Nov 2026 19:08:44 +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=IbCHwUjh Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DBD01F00897; Mon, 30 Nov 2026 19:08:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796065724; bh=Fm4IcTTdyjuxJaTyB3zRFIJvg5nwpEmJwLlA0K8itEM=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=IbCHwUjhwUj9OHBxg2VkZZ1lc2i4RwUgqWhgJMl0haan2awwXpF3VFVYBaDJjkMmd /BT+9Qd8Vowby56qlis7ENMqGE1Cfl6x/fc0ZMnlc7I5piWQJzcCzH+F7x6jbYXWvq H9HSSw/s2UZNh2JyMuoKXxBp94F+cglxIqM2Je6gD861kplC8oDLJRaHeuhfQhRoQn WsC/XqCM/72XOIM6z1J/cEU3xrY6X7C7orDHTiLWzGbW7zye7vGCIegiGdt7ELHy34 Z8DUqjp7dmT5aiS0RcgChfM2a544fIKfzuO7QsCeIoqIOZXip4jBKj621GHFE8iXlZ goagPbJlg5bMg== Date: Mon, 30 Nov 2026 20:08:39 +0100 From: "Oscar Salvador (SUSE)" To: Zhengchuan Liang Cc: Muchun Song , Oscar Salvador , David Hildenbrand , Andrew Morton , Davidlohr Bueso , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/hugetlb: stop hashing address_space pointers for fault mutexes Message-ID: References: <9a97a64f7e7aabc668499c426a2417a77d13a2f4.1795587203.git.zcliangcn@gmail.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <9a97a64f7e7aabc668499c426a2417a77d13a2f4.1795587203.git.zcliangcn@gmail.com> On Tue, Nov 24, 2026 at 10:15:21PM -0800, Zhengchuan Liang wrote: > hugetlb_fault_mutex_hash() uses the address_space pointer and page index > to select an entry in a global mutex table. An unprivileged user can > create a no-reserve HugeTLB memfd with an empty huge page pool, build > contention on one index, and time SIGBUS faults at chosen indices. > Pointer-dependent mutex collisions expose equations that recover the > exact address_space address. > > Give each hugetlbfs inode a dedicated random hash seed instead, and hash > the page index with that value. Operations on the same mapping continue > to select the same mutex, while separate mappings retain independent > bucket distributions without encoding an address. The seed is not > relied upon as a secret and is not reused by another hash table. > > Fixes: 8382d914ebf7 ("mm, hugetlb: improve page-fault scalability") > Cc: stable@vger.kernel.org > Signed-off-by: Zhengchuan Liang With the "const" fix, you can add: Acked-by: Oscar Salvador (SUSE)