[PATCH v3 0/3] Filter out local and mapping symbols during module load

Tiezhu Yang posted 3 patches 1 month, 2 weeks ago
include/linux/module_symbol.h |  4 +--
kernel/module/kallsyms.c      | 59 ++++++++++++++++++-----------------
scripts/faddr2line            |  2 +-
scripts/mod/modpost.h         |  2 +-
4 files changed, 35 insertions(+), 32 deletions(-)
[PATCH v3 0/3] Filter out local and mapping symbols during module load
Posted by Tiezhu Yang 1 month, 2 weeks ago
This series prevents compiler generated local and mapping symbols
from leaking into /proc/kallsyms for loaded modules. This ensures
tracing tools like bpftrace can resolve accurate kernel stacks on
architectures like LoongArch.

Based on the v2 discussion, the changes are now refactored into a
clean three-patch series to eliminate code duplication and clarify
naming.

Tiezhu Yang (3):
  module/kallsyms: Rename is_mapping_symbol() to
    is_local_mapping_symbol()
  module/kallsyms: Refactor current symbol filtering into
    is_kept_symbol()
  module/kallsyms: Filter out local and mapping symbols during module
    load

 include/linux/module_symbol.h |  4 +--
 kernel/module/kallsyms.c      | 59 ++++++++++++++++++-----------------
 scripts/faddr2line            |  2 +-
 scripts/mod/modpost.h         |  2 +-
 4 files changed, 35 insertions(+), 32 deletions(-)

-- 
2.42.0
Re: [PATCH v3 0/3] Filter out local and mapping symbols during module load
Posted by Huacai Chen 1 month, 2 weeks ago
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>

But I still don't think renaming is_core_symbol() to is_kept_symbol()
is necessary.

Huacai

On Wed, Aug 12, 2026 at 11:28 AM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
> This series prevents compiler generated local and mapping symbols
> from leaking into /proc/kallsyms for loaded modules. This ensures
> tracing tools like bpftrace can resolve accurate kernel stacks on
> architectures like LoongArch.
>
> Based on the v2 discussion, the changes are now refactored into a
> clean three-patch series to eliminate code duplication and clarify
> naming.
>
> Tiezhu Yang (3):
>   module/kallsyms: Rename is_mapping_symbol() to
>     is_local_mapping_symbol()
>   module/kallsyms: Refactor current symbol filtering into
>     is_kept_symbol()
>   module/kallsyms: Filter out local and mapping symbols during module
>     load
>
>  include/linux/module_symbol.h |  4 +--
>  kernel/module/kallsyms.c      | 59 ++++++++++++++++++-----------------
>  scripts/faddr2line            |  2 +-
>  scripts/mod/modpost.h         |  2 +-
>  4 files changed, 35 insertions(+), 32 deletions(-)
>
> --
> 2.42.0
>
>
Re: [PATCH v3 0/3] Filter out local and mapping symbols during module load
Posted by Huacai Chen 1 month, 1 week ago
On Wed, Aug 12, 2026 at 11:17 PM Huacai Chen <chenhuacai@kernel.org> wrote:
>
> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
>
> But I still don't think renaming is_core_symbol() to is_kept_symbol()
> is necessary.
And this series needs to backport to stable branches, no renaming can
reduce the difficulty.

Huacai

>
> Huacai
>
> On Wed, Aug 12, 2026 at 11:28 AM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
> >
> > This series prevents compiler generated local and mapping symbols
> > from leaking into /proc/kallsyms for loaded modules. This ensures
> > tracing tools like bpftrace can resolve accurate kernel stacks on
> > architectures like LoongArch.
> >
> > Based on the v2 discussion, the changes are now refactored into a
> > clean three-patch series to eliminate code duplication and clarify
> > naming.
> >
> > Tiezhu Yang (3):
> >   module/kallsyms: Rename is_mapping_symbol() to
> >     is_local_mapping_symbol()
> >   module/kallsyms: Refactor current symbol filtering into
> >     is_kept_symbol()
> >   module/kallsyms: Filter out local and mapping symbols during module
> >     load
> >
> >  include/linux/module_symbol.h |  4 +--
> >  kernel/module/kallsyms.c      | 59 ++++++++++++++++++-----------------
> >  scripts/faddr2line            |  2 +-
> >  scripts/mod/modpost.h         |  2 +-
> >  4 files changed, 35 insertions(+), 32 deletions(-)
> >
> > --
> > 2.42.0
> >
> >