lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251116223055.684054-1-ojeda@kernel.org>
Date: Sun, 16 Nov 2025 23:30:55 +0100
From: Miguel Ojeda <ojeda@...nel.org>
To: zhengyejian@...weicloud.com
Cc: ardb@...nel.org,
	arnd@...db.de,
	boqun.feng@...il.com,
	gary@...yguo.net,
	gregkh@...uxfoundation.org,
	jannh@...gle.com,
	kees@...nel.org,
	linux-kernel@...r.kernel.org,
	masahiroy@...nel.org,
	mcgrof@...nel.org,
	ndesaulniers@...gle.com,
	song@...nel.org,
	wedsonaf@...gle.com,
	willy@...radead.org,
	yeweihua4@...wei.com
Subject: Re: [PATCH v2] kallsyms: Fix wrong "big" kernel symbol type read from procfs

On Fri, 11 Oct 2024 22:38:53 +0800 Zheng Yejian <zhengyejian@...weicloud.com> wrote:
>
> Currently when the length of a symbol is longer than 0x7f characters,
> its type shown in /proc/kallsyms can be incorrect.
>
> I found this issue when reading the code, but it can be reproduced by
> following steps:
>
>   1. Define a function which symbol length is 130 characters:
>
>     #define X13(x) x##x##x##x##x##x##x##x##x##x##x##x##x
>     static noinline void X13(x123456789)(void)
>     {
>         printk("hello world\n");
>     }
>
>   2. The type in vmlinux is 't':
>
>     $ nm vmlinux | grep x123456
>     ffffffff816290f0 t x123456789x123456789x123456789x12[...]
>
>   3. Then boot the kernel, the type shown in /proc/kallsyms becomes 'g'
>      instead of the expected 't':
>
>     # cat /proc/kallsyms | grep x123456
>     ffffffff816290f0 g x123456789x123456789x123456789x12[...]
>
> The root cause is that, after commit 73bbb94466fd ("kallsyms: support
> "big" kernel symbols"), ULEB128 was used to encode symbol name length.
> That is, for "big" kernel symbols of which name length is longer than
> 0x7f characters, the length info is encoded into 2 bytes.
>
> kallsyms_get_symbol_type() expects to read the first char of the
> symbol name which indicates the symbol type. However, due to the
> "big" symbol case not being handled, the symbol type read from
> /proc/kallsyms may be wrong, so handle it properly.
>
> Cc: stable@...r.kernel.org
> Fixes: 73bbb94466fd ("kallsyms: support "big" kernel symbols")
> Signed-off-by: Zheng Yejian <zhengyejian@...weicloud.com>

Applied to `rust-fixes` -- thanks everyone!

Let's get some linux-next testing.

If someone is against this or wants to pick it up, please shout!

Cheers,
Miguel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ