From: Uladzislau Rezki <urezki@gmail.com>
To: Hao Ge <hao.ge@linux.dev>
Cc: Suren Baghdasaryan <surenb@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Kent Overstreet <kent.overstreet@linux.dev>,
Luis Chamberlain <mcgrof@kernel.org>,
Petr Pavlu <petr.pavlu@suse.com>,
Daniel Gomez <da.gomez@kernel.org>,
Sami Tolvanen <samitolvanen@google.com>,
Aaron Tomlin <atomlin@atomlin.com>,
Alexander Potapenko <glider@google.com>,
Marco Elver <elver@google.com>,
Dmitry Vyukov <dvyukov@google.com>,
Vlastimil Babka <vbabka@kernel.org>,
Michal Hocko <mhocko@suse.com>,
Brendan Jackman <brendan.jackman@linux.dev>,
Johannes Weiner <hannes@cmpxchg.org>, Zi Yan <ziy@nvidia.com>,
Uladzislau Rezki <urezki@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-modules@vger.kernel.org, kasan-dev@googlegroups.com
Subject: Re: [PATCH v11 0/7] alloc_tag and module codetag section fixes
Date: Wed, 30 Sep 2026 10:34:03 +0200 [thread overview]
Message-ID: <arzJez4VNWEVnXiF@milan> (raw)
In-Reply-To: <fc4f3d08-393f-43ed-934b-e7e1ba6d0137@linux.dev>
On Wed, Sep 30, 2026 at 11:26:41AM +0800, Hao Ge wrote:
> Hi Suren and Andrew
>
>
> On 2026/9/30 10:39, Suren Baghdasaryan wrote:
> > On Tue, Sep 29, 2026 at 8:44 PM Andrew Morton <akpm@linux-foundation.org> wrote:
> >>
> >> On Tue, 29 Sep 2026 16:20:07 +0800 Hao Ge <hao.ge@linux.dev> wrote:
> >>
> >>> With profiling toggled off, the overflow check in
> >>> reserve_module_tags() did not run, a module could load with more
> >>> tags than the page flags can address, and re-enabling profiling
> >>> then silently corrupted /proc/allocinfo. On overflow the fix shuts
> >>> profiling down, releases the reservation and returns -EAGAIN, and
> >>> the codetag section lands as regular module data in the same load,
> >>> so the module loads without profiling.
> >>>
> >>> Review of the earlier series by Sashiko turned up more problems.
> >>>
> >>> One is a race. layout_sections() and move_module() both asked
> >>> codetag_needs_module_section() where a codetag section goes, and
> >>> mem_profiling_support can change between the two calls, for instance
> >>> when another module load overflows the tag index and shuts profiling
> >>> down. move_module() then copied the codetag section to offset 0 of
> >>> its regular destination and clobbered the first section placed in
> >>> that region.
> >>>
> >>> v7 reworks where codetag sections are allocated, on a prototype by
> >>> Petr Pavlu [1]. The allocation runs before layout_sections() and the
> >>> placement is decided in one step, so nothing re-asks the question
> >>> and the race is gone. The retry is gone too, on -EAGAIN the section
> >>> is laid out as regular module data right in the same load.
> >>
> >> Thanks.
> >>
> >> Seven patches, all cc:stable. Why is a backport proposed?
> >> Documentation/process/stable-kernel-rules.rst gives guidelines - does
> >> this series meet them? Does Suren have thoughts?
>
> Thanks, I've just gone through this carefully.
>
> >
> > I think vmalloc fix in patch#2 should be posted separately and clearly
> > quialifies for backporting as if fixes issues Hao found at [1].
>
> Agreed. Patch #2 was added to this patch series because vm_module_tags_populate
> suffers from the same issue. If we want to be more conservative, I'd prefer to keep
> vm_module_tags_populate as it was in V10:
> https://lore.kernel.org/all/20260915070001.113559-3-hao.ge@linux.dev/
>
> Then we can submit a fix for __GFP_NOFAIL retry loop in __vmalloc_area_node() as a hotfix together
> with our new patch #2. While at it, we can also check if there are any unnecessary calls to
> vunmap_range family functions that can be cleaned up now that patch #2 is applied.
>
Yep, this should be a separate fix for vmalloc.
--
Uladzislau Rezki
next prev parent reply other threads:[~2026-09-30 8:34 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 8:20 [PATCH v11 0/7] alloc_tag and module codetag section fixes Hao Ge
2026-09-29 8:20 ` [PATCH v11 1/7] alloc_tag: move release_module_tags() above reserve_module_tags() Hao Ge
2026-09-29 8:20 ` [PATCH v11 2/7] mm/vmalloc: undo partial mappings inside the mapping functions Hao Ge
2026-09-29 8:33 ` sashiko-bot
2026-09-30 10:12 ` Uladzislau Rezki
2026-10-04 17:42 ` Suren Baghdasaryan
2026-10-09 8:23 ` Hao Ge
2026-10-08 6:53 ` Hao Ge
2026-10-08 8:09 ` Hao Ge
2026-10-08 8:13 ` Hao Ge
2026-09-29 8:20 ` [PATCH v11 3/7] alloc_tag: clean up the populate failure path Hao Ge
2026-10-04 17:55 ` Suren Baghdasaryan
2026-09-29 8:20 ` [PATCH v11 4/7] module: introduce SH_ENTSIZE_STANDALONE for separately allocated sections Hao Ge
2026-09-29 8:20 ` [PATCH v11 5/7] module: allocate codetag sections before the regular module layout Hao Ge
2026-09-29 8:20 ` [PATCH v11 6/7] alloc_tag: skip percpu counter allocation when profiling is disabled Hao Ge
2026-09-29 8:40 ` sashiko-bot
2026-09-29 8:20 ` [PATCH v11 7/7] alloc_tag: fix the /proc/allocinfo lifecycle Hao Ge
2026-10-04 18:23 ` Suren Baghdasaryan
2026-10-09 11:16 ` Hao Ge
2026-09-29 20:44 ` [PATCH v11 0/7] alloc_tag and module codetag section fixes Andrew Morton
2026-09-30 2:39 ` Suren Baghdasaryan
2026-09-30 3:26 ` Hao Ge
2026-09-30 8:34 ` Uladzislau Rezki [this message]
2026-10-04 17:42 ` Suren Baghdasaryan
2026-10-04 18:37 ` Suren Baghdasaryan
2026-10-09 11:30 ` Hao Ge
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=arzJez4VNWEVnXiF@milan \
--to=urezki@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=atomlin@atomlin.com \
--cc=brendan.jackman@linux.dev \
--cc=da.gomez@kernel.org \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=hannes@cmpxchg.org \
--cc=hao.ge@linux.dev \
--cc=kasan-dev@googlegroups.com \
--cc=kent.overstreet@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-modules@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=mhocko@suse.com \
--cc=petr.pavlu@suse.com \
--cc=samitolvanen@google.com \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=ziy@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.