From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 684823A382E for ; Tue, 31 Mar 2026 20:10:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774987855; cv=none; b=g5yd7/t/T50w+jI9WLRfho5VhrJcVBmiO1R+bDsOqPE4Ak/s/pSnIl33ba9/hy4oUitlOFRHhYvr4MmbfCBLBvsz+fVoixY/5w7VsoV7GMIg008zvMt5pjgJqNr6aDJy+FFSWjwsixuI1qQCVsHNU9q5jddaiKZpOwKgWBvFoVk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774987855; c=relaxed/simple; bh=+Yio7/ri0s/iJL0oI/nYBoKFzbIqiKCVNVdJ6dIkhDU=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=khhW/gyX5bG09YHkopl8JGhWoz7JBdkuhWQZJgk4AYNdYwIJYN3FrvV+0GM8N+WlekEMedOa7icX9+hBL4nWGP9Td5c1XXYMcBu3kELMMgZ/FwguTEo2/2Hcc8tnMaT8ZcZWziMCQ5+/noG96fpEL+lQWJUUbl2M6yuJmKXcygg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=Li1mXvhi; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="Li1mXvhi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F11EC19423; Tue, 31 Mar 2026 20:10:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1774987855; bh=+Yio7/ri0s/iJL0oI/nYBoKFzbIqiKCVNVdJ6dIkhDU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Li1mXvhiMq5g/jZpq8A83N8h1xx9VwEqAFLdT1/yfdcvN0woeT/PXqPJKSk0HL+Xc mv9U7u5QwFuVPKhRK6hOQmBJGYdOEo/Jf5MPKTiBEkiOWl5Vsfkmg/fWrHrLMwYwVx X/AYi5V6eMOwkrS/ertDT+mMgMIdNxTrcNpElmVA= Date: Tue, 31 Mar 2026 13:10:54 -0700 From: Andrew Morton To: Muchun Song Cc: David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Frank van der Linden , linux-mm@kvack.org, linux-kernel@vger.kernel.org, muchun.song@linux.dev Subject: Re: [PATCH] mm/sparse: fix preinited section_mem_map clobbering on failure path Message-Id: <20260331131054.0164f3b3ab6f7868add37cd3@linux-foundation.org> In-Reply-To: <20260331113724.2080833-1-songmuchun@bytedance.com> References: <20260331113724.2080833-1-songmuchun@bytedance.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 31 Mar 2026 19:37:24 +0800 Muchun Song wrote: > sparse_init_nid() is careful to leave alone every section whose vmemmap > has already been set up by sparse_vmemmap_init_nid_early(); it only > clears section_mem_map for the rest: > > if (!preinited_vmemmap_section(ms)) > ms->section_mem_map = 0; > > A leftover line after that conditional block > > ms->section_mem_map = 0; > > was supposed to be deleted but was missed in the failure path, causing the > field to be overwritten for all sections when memory allocation fails, > effectively destroying the pre-initialization check. > > Drop the stray assignment so that preinited sections retain their > already valid state. Here I go again ;) Are there userspace impacts? AI review thinks it found a different bug: https://sashiko.dev/#/patchset/20260331113724.2080833-1-songmuchun@bytedance.com