The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Muchun Song <songmuchun@bytedance.com>
Cc: Kaitao Cheng <kaitao.cheng@linux.dev>,
	David Hildenbrand <david@kernel.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Vlastimil Babka <vbabka@kernel.org>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>, Minchan Kim <minchan@kernel.org>,
	digetx@gmail.com, John Hubbard <jhubbard@nvidia.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Kaitao Cheng <chengkaitao@kylinos.cn>
Subject: Re: [PATCH] mm/cma_sysfs: Skip inactive CMA areas in sysfs
Date: Fri, 22 May 2026 19:49:10 -0700	[thread overview]
Message-ID: <20260522194910.9395371c3d3d1bfb87cd1211@linux-foundation.org> (raw)
In-Reply-To: <CAMZfGtWO7=UfnVB9oR6sS6eGSBv0-pKciFqpoB60aq66fYTSow@mail.gmail.com>

On Fri, 22 May 2026 21:26:59 +0800 Muchun Song <songmuchun@bytedance.com> wrote:

> On Fri, May 22, 2026 at 9:15 PM Kaitao Cheng <kaitao.cheng@linux.dev> wrote:
> >
> > From: Kaitao Cheng <chengkaitao@kylinos.cn>
> >
> > cma_activate_area() can fail after a CMA area has already been added to
> > cma_areas[].  In that case the area is left in the global array, but it
> > does not reach the point where CMA_ACTIVATED is set.
> >
> > cma_sysfs_init() currently walks all cma_area_count entries and creates
> > sysfs files for every area, including ones that failed activation.  These
> > areas are not usable CMA areas and should not be exposed to userspace as
> > valid CMA regions.
> >
> > Skip CMA areas that did not reach CMA_ACTIVATED when creating the sysfs
> > objects.  Since inactive entries can now be skipped, make the error
> > unwind tolerate entries that never had cma_kobj initialized.
> >
> > Fixes: 43ca106fa8ec ("mm: cma: support sysfs")
> 
> Actually, this is not a fix since there is no serious issue when accessing those
> sysfs files. I think it is an improvement.

I find it hard to say because the changelog doesn't have a clear
description of the userspace-visible impact of the bug.

> > Reported-by: David Hildenbrand (Arm) <david@kernel.org>
> > Reported-by: Muchun Song <songmuchun@bytedance.com>
> > Closes: https://lore.kernel.org/linux-mm/55481a8b-dcfc-4bef-ba59-aa0b43dca88b@kernel.org/

That says "Reading the bitmap file can make debugfs walk a freed range
bitmap and trigger an invalid memory access".   Maybe it oopses?

So Kaitao, can you please send us a clear and complete description of
how this bug affects downstream users?


  reply	other threads:[~2026-05-23  2:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-22 13:14 [PATCH] mm/cma_sysfs: Skip inactive CMA areas in sysfs Kaitao Cheng
2026-05-22 13:26 ` Muchun Song
2026-05-23  2:49   ` Andrew Morton [this message]
2026-05-23  6:21     ` Muchun Song
  -- strict thread matches above, loose matches on Subject: below --
2026-05-24 14:04 Kaitao Cheng

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=20260522194910.9395371c3d3d1bfb87cd1211@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=chengkaitao@kylinos.cn \
    --cc=david@kernel.org \
    --cc=digetx@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jhubbard@nvidia.com \
    --cc=kaitao.cheng@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=minchan@kernel.org \
    --cc=rppt@kernel.org \
    --cc=songmuchun@bytedance.com \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    /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