From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.26 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796366460; b=LvLUmlP4sGwWpsZTRrYgh5uauaPpDkjmF6LMd26F9EvIWOjEBiHIqAFr2qADkpeKS8G1 FyiEj4MYSmNKknX1ygDHyTWmiqydw4Wq4EUd6Echk+uYTPH5hIE9gxlFvy6wBTIJvN1Yn hWaAOqwAcz89d/tQAgc8CvwK3KAJRRcCOmakQhxDEalGVa+WxKjNo1zIKbS267O7Yzps0 J9bAQMD226Zdm4RwQmQOfYP4AHnyz1oeGbLqQB00GOY4waHHKpQif7cs0R+g9z8UstIi2 +qxS+L9/wJVkAWz6CKZVjnNFTKBH/3B9wkpDeUB3kH9nbog5NHSPMeaTa9lEb7lPupg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796366460; 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=sqbCAnpJ7plARebxjEvCoOM/pkMQmPhSP8ZpsoVULaw=; b=qBaZwM8eTYJDPUvI0OCgU+HtNfVmWyUN/SWdK82k7nVerCC0lSD+mA73zPpERKYPyCSs IyCmdF0I3YESFVpnpPqB5/OXKFJ91uAJDfRtWsxeM64+X1Fo32RpojZcNfA+homphKFia HJh7BsMXPRh3qZX4DSxOcL3Go4J5QeZGsigw4FgnfYXfxUEgQOBCGpc937J8PXZNCN7+r 9E8l2ZM78jEY7Pii+TCcjbiEpn6e7h5xI/vb2aNNdDXaXIM8ZSrIy5rS3xYq88e6qcxo/ RZIvB7N9X0bxRPk04kV5h8+xL8Uw+kzP1snJ1Jgi2lo8pwcx8+NXfosyPpqx18Yw2lQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=xqt4FS6u; arc=none smtp.remote-ip=91.218.175.26 Received: from mta0.migadu.com (out-26.mta0.migadu.com [91.218.175.26]) (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 0C23A606A322 for ; Fri, 4 Dec 2026 06:40:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0C23A606A322 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, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=xqt4FS6u X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=TEGRUCEYUh/PU1YymPmYKMayJqhyDZajkK1kIm9YUXw=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796366457; v=1; x=1796971257; b=xqt4FS6uaRQLWy1KRIA+1ZcjhKxDQ/NsIsyxtjVAY8f4OTE5AKa313dwZ214hCwUjXRrqjqE fNwXIlLO/pJVf7w4m+C4SLT6kXuKAYc0xgNJOxYewgJTbcBmBXRJTj4Hz0NwPPvvH0dT5gXfWco xuYypq0MXrwGnBFmXz/DdIu0= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id e2a6430a870bbd1f; Fri, 04 Dec 2026 06:40:56 +0000 X-Mizu-Trace-ID: e2a6430a870bbd1f X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset=us-ascii 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 (Mac OS X Mail 16.0 \(3901.200.71.1.16\)) Subject: Re: [PATCH v2 25/35] hugetlbfs: zero all hugetlbfs-specific fields of new inodes From: Muchun Song In-Reply-To: <20261203-hugetlb_fixes_2-v2-25-9bbeabb555d2@kernel.org> Date: Fri, 4 Dec 2026 14:29:36 +0800 Cc: Muchun Song , Oscar Salvador , Andrew Morton , Hongfu Li , Jinmeng Zhou , Mina Almasry , Davidlohr Bueso , Naoya Horiguchi , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Michal Hocko , Jonathan Corbet , Shuah Khan , Randy Dunlap , Vivek Kasireddy , Mel Gorman , Hugh Dickins , Baolin Wang , Dave Airlie , Jason Gunthorpe , Andy Whitcroft , Roman Gushchin , Barry Song , Andrea Arcangeli , Lorenzo Stoakes , Suren Baghdasaryan , Shakeel Butt , Pedro Falcato , Jann Horn , Guillaume Morin , Yang Shi , James Houghton , Rik van Riel , Harry Yoo , Lance Yang , Axel Rasmussen , Peter Xu , Sasha Levin , Kiryl Shutsemau , Christian Brauner , "Steven Rostedt (Google)" , Hongbo Li , Gregory Price , Zi Yan , Joshua Hahn , Rakie Kim , Ying Huang , Matthew Brost , Byungchul Park , Alistair Popple , Andi Kleen , David Rientjes , Joern Engel , "Aneesh Kumar K.V" , linux-mm@kvack.org, linux-doc@vger.kernel.org, Gerd Hoffmann , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Johannes Weiner , Chris Mason , Jiaqi Yan , Sashiko Content-Transfer-Encoding: 7bit Message-Id: <230F248B-46DA-4EAE-926B-2A30ACA97EB0@linux.dev> References: <20261203-hugetlb_fixes_2-v2-0-9bbeabb555d2@kernel.org> <20261203-hugetlb_fixes_2-v2-25-9bbeabb555d2@kernel.org> To: "David Hildenbrand (Arm)" X-Mailer: Apple Mail (2.3901.200.71.1.16) > On Dec 3, 2026, at 19:37, David Hildenbrand (Arm) wrote: > > hugetlbfs_get_inode() initializes the seals of new hugetlbfs inodes, and > the hugetlbfs inode tracepoints record them. > > However, we don't initialize the seals in two cases: > > (1) For the root inode through hugetlbfs_get_root() > > (2) For an inode that alloc_inode() destroys right away because > inode_init_always() failed. > > Consequently, when such an inode is evicted or destroyed with the > tracepoints enabled, we record stale seals, and KMSAN reports an > uninit-value. > > Reproduced by closing a hugetlb memfd with seals, and mounting and > unmounting hugetlbfs with the hugetlbfs_evict_inode tracepoint enabled: > the root inode reports the seals of the memfd. > > Let's fix it by zeroing all hugetlbfs-specific inode fields when > allocating the inode in hugetlbfs_alloc_inode(). > > We can now drop the manual initialization of resv_map in > hugetlbfs_get_root(). > > This has low urgency, as it only affects the tracepoints. No need to CC > stable. > > Fixes: 318580ad7f28 ("hugetlbfs: support tracepoint") > Reported-by: Sashiko > Signed-off-by: David Hildenbrand (Arm) Acked-by: Muchun Song (ByteDance) Thanks.