public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Uladzislau Rezki <urezki@gmail.com>
To: Qing Wang <wangqing7171@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Uladzislau Rezki <urezki@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	syzbot+37b7f6cd519f7fb8d32a@syzkaller.appspotmail.com
Subject: Re: [PATCH] mm/vmalloc: fix KMSAN uninit-value warning in decay_va_pool_node()
Date: Thu, 2 Apr 2026 17:45:44 +0200	[thread overview]
Message-ID: <ac6PKPR8vMlIUdwT@milan> (raw)
In-Reply-To: <20260402081413.1896640-1-wangqing7171@gmail.com>

On Thu, Apr 02, 2026 at 04:14:13PM +0800, Qing Wang wrote:
> KMSAN reported an uninit-value warning when accessing vmap_area->list
> in decay_va_pool_node():
> 
>   BUG: KMSAN: uninit-value in __list_del_entry_valid include/linux/list.h:-1 [inline]
>   BUG: KMSAN: uninit-value in __list_del_entry include/linux/list.h:223 [inline]
>   BUG: KMSAN: uninit-value in list_del_init include/linux/list.h:295 [inline]
>   BUG: KMSAN: uninit-value in decay_va_pool_node+0xf78/0x1dd0 mm/vmalloc.c:2255
> 
>   Uninit was created at:
>    kmem_cache_alloc_node_noprof+0x3cd/0x12d0 mm/slub.c:4918
>    alloc_vmap_area+0x327/0x2e30 mm/vmalloc.c:2065
> 
> The root cause is that if node_alloc() fail and the va is allocated via
> kmem_cache_alloc_node() by alloc_vmap_area(), va->list will be uninitialized.
> 
> Fix this by explicitly initializing va->list after allocation.
> 
> Reported-by: syzbot+37b7f6cd519f7fb8d32a@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=37b7f6cd519f7fb8d32a
>
I can not access two above links. Are they valid? I would like to have
a look at report.

> Signed-off-by: Qing Wang <wangqing7171@gmail.com>
> ---
>  mm/vmalloc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 61caa55a4402..8aebbb51e178 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -2071,6 +2071,7 @@ static struct vmap_area *alloc_vmap_area(unsigned long size,
>  		 * to avoid false negatives.
>  		 */
>  		kmemleak_scan_area(&va->rb_node, SIZE_MAX, gfp_mask);
> +		INIT_LIST_HEAD(&va->list);
>  	}
>
va->list does not require to be initialized. Because:

	spin_lock(&vn->busy.lock);
	insert_vmap_area(va, &vn->busy.root, &vn->busy.head);
	spin_unlock(&vn->busy.lock);

when a node is inserted into list_head, its next/prev pointers are
properly set by the list_add().

Or, am i missing something?

--
Uladzislau Rezki




  parent reply	other threads:[~2026-04-02 15:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-02  8:14 [PATCH] mm/vmalloc: fix KMSAN uninit-value warning in decay_va_pool_node() Qing Wang
2026-04-02 10:31 ` Uladzislau Rezki
2026-04-02 15:45 ` Uladzislau Rezki [this message]
2026-04-03  2:56   ` Qing Wang
2026-04-03  3:30     ` Morduan Zang
2026-04-03  3:50       ` Qing Wang
2026-04-03  3:14   ` Qing Wang
2026-04-03  7:52 ` [PATCH] mm/vmalloc: fix KMSAN uninit in decay_va_pool_node list handling chenyichong
2026-04-03 10:55   ` Uladzislau Rezki
2026-04-03 17:22     ` Uladzislau Rezki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac6PKPR8vMlIUdwT@milan \
    --to=urezki@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=syzbot+37b7f6cd519f7fb8d32a@syzkaller.appspotmail.com \
    --cc=wangqing7171@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox