public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] vsock/test: Do not filter kallsyms by symbol type
@ 2026-01-16  8:52 Michal Luczaj
  2026-01-16 10:11 ` Stefano Garzarella
  2026-01-20 15:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Michal Luczaj @ 2026-01-16  8:52 UTC (permalink / raw)
  To: Stefano Garzarella, Luigi Leonardi, Jakub Kicinski
  Cc: virtualization, netdev, linux-kernel, Michal Luczaj

Blamed commit implemented logic to discover available vsock transports by
grepping /proc/kallsyms for known symbols. It incorrectly filtered entries
by type 'd'.

For some kernel configs having

    CONFIG_VIRTIO_VSOCKETS=m
    CONFIG_VSOCKETS_LOOPBACK=y

kallsyms reports

    0000000000000000 d virtio_transport	[vmw_vsock_virtio_transport]
    0000000000000000 t loopback_transport

Overzealous filtering might have affected vsock test suit, resulting in
insufficient/misleading testing.

Do not filter symbols by type. It never helped much.

Fixes: 3070c05b7afd ("vsock/test: Introduce get_transports()")
Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
man nm says: 't' stands for symbol is in the text (code) section. Is this
correct for `static struct virtio_transport loopback_transport`?
---
 tools/testing/vsock/util.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/vsock/util.h b/tools/testing/vsock/util.h
index 142c02a6834a..bf633cde82b0 100644
--- a/tools/testing/vsock/util.h
+++ b/tools/testing/vsock/util.h
@@ -25,7 +25,7 @@ enum transport {
 };
 
 static const char * const transport_ksyms[] = {
-	#define x(name, symbol) "d " symbol "_transport",
+	#define x(name, symbol) " " symbol "_transport",
 	KNOWN_TRANSPORTS(x)
 	#undef x
 };

---
base-commit: a74c7a58ca2ca1cbb93f4c01421cf24b8642b962
change-id: 20260113-vsock_test-kallsyms-grep-e08cd920621d

Best regards,
-- 
Michal Luczaj <mhal@rbox.co>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] vsock/test: Do not filter kallsyms by symbol type
  2026-01-16  8:52 [PATCH net] vsock/test: Do not filter kallsyms by symbol type Michal Luczaj
@ 2026-01-16 10:11 ` Stefano Garzarella
  2026-01-16 15:54   ` Michal Luczaj
  2026-01-20 15:50 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Stefano Garzarella @ 2026-01-16 10:11 UTC (permalink / raw)
  To: Michal Luczaj
  Cc: Luigi Leonardi, Jakub Kicinski, virtualization, netdev,
	linux-kernel

On Fri, Jan 16, 2026 at 09:52:36AM +0100, Michal Luczaj wrote:
>Blamed commit implemented logic to discover available vsock transports by
>grepping /proc/kallsyms for known symbols. It incorrectly filtered entries
>by type 'd'.
>
>For some kernel configs having
>
>    CONFIG_VIRTIO_VSOCKETS=m
>    CONFIG_VSOCKETS_LOOPBACK=y
>
>kallsyms reports
>
>    0000000000000000 d virtio_transport	[vmw_vsock_virtio_transport]
>    0000000000000000 t loopback_transport
>
>Overzealous filtering might have affected vsock test suit, resulting in
>insufficient/misleading testing.
>
>Do not filter symbols by type. It never helped much.
>
>Fixes: 3070c05b7afd ("vsock/test: Introduce get_transports()")
>Signed-off-by: Michal Luczaj <mhal@rbox.co>
>---
>man nm says: 't' stands for symbol is in the text (code) section. Is this
>correct for `static struct virtio_transport loopback_transport`?

I'm not an expert, but yeah I was expecting "d" too, but maybe since
it's static and built-in will be in the text section?

BTW I just checked and for example on my 6.18.4-100.fc42.x86_64 I have:

0000000000000000 t sock_fs_type
0000000000000000 t proto_net_ops
0000000000000000 t net_inuse_ops

And they are all static structs of built-in modules.
So it seems it is common.

>---
> tools/testing/vsock/util.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks for the fix!

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

>
>diff --git a/tools/testing/vsock/util.h b/tools/testing/vsock/util.h
>index 142c02a6834a..bf633cde82b0 100644
>--- a/tools/testing/vsock/util.h
>+++ b/tools/testing/vsock/util.h
>@@ -25,7 +25,7 @@ enum transport {
> };
>
> static const char * const transport_ksyms[] = {
>-	#define x(name, symbol) "d " symbol "_transport",
>+	#define x(name, symbol) " " symbol "_transport",
> 	KNOWN_TRANSPORTS(x)
> 	#undef x
> };
>
>---
>base-commit: a74c7a58ca2ca1cbb93f4c01421cf24b8642b962
>change-id: 20260113-vsock_test-kallsyms-grep-e08cd920621d
>
>Best regards,
>-- 
>Michal Luczaj <mhal@rbox.co>
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] vsock/test: Do not filter kallsyms by symbol type
  2026-01-16 10:11 ` Stefano Garzarella
@ 2026-01-16 15:54   ` Michal Luczaj
  0 siblings, 0 replies; 4+ messages in thread
From: Michal Luczaj @ 2026-01-16 15:54 UTC (permalink / raw)
  To: Stefano Garzarella
  Cc: Luigi Leonardi, Jakub Kicinski, virtualization, netdev,
	linux-kernel

On 1/16/26 11:11, Stefano Garzarella wrote:
> On Fri, Jan 16, 2026 at 09:52:36AM +0100, Michal Luczaj wrote:
>> Blamed commit implemented logic to discover available vsock transports by
>> grepping /proc/kallsyms for known symbols. It incorrectly filtered entries
>> by type 'd'.
>>
>> For some kernel configs having
>>
>>    CONFIG_VIRTIO_VSOCKETS=m
>>    CONFIG_VSOCKETS_LOOPBACK=y
>>
>> kallsyms reports
>>
>>    0000000000000000 d virtio_transport	[vmw_vsock_virtio_transport]
>>    0000000000000000 t loopback_transport
>>
>> Overzealous filtering might have affected vsock test suit, resulting in
>> insufficient/misleading testing.
>>
>> Do not filter symbols by type. It never helped much.
>>
>> Fixes: 3070c05b7afd ("vsock/test: Introduce get_transports()")
>> Signed-off-by: Michal Luczaj <mhal@rbox.co>
>> ---
>> man nm says: 't' stands for symbol is in the text (code) section. Is this
>> correct for `static struct virtio_transport loopback_transport`?
> 
> I'm not an expert, but yeah I was expecting "d" too, but maybe since
> it's static and built-in will be in the text section?

But it does not end up in the text section. Address points at RW NX
(read-writeable non-executable) pages. Please see below.

> BTW I just checked and for example on my 6.18.4-100.fc42.x86_64 I have:
> 
> 0000000000000000 t sock_fs_type
> 0000000000000000 t proto_net_ops
> 0000000000000000 t net_inuse_ops
> 
> And they are all static structs of built-in modules.
> So it seems it is common.

$ mv .config .config.orig
$ vng -k --configitem RANDOMIZE_BASE=n --configitem CONFIG_PTDUMP_DEBUGFS=y
$ vng -b
$ vng --user root "grep sock_fs_type /proc/kallsyms"
ffffffff82c1f000 t sock_fs_type
$ vng --user root "grep 0xffffffff82 /sys/kernel/debug/page_tables/kernel"
0xffffffff82a00000-0xffffffff83000000     6M    RW    PSE   GLB NX pmd

And if I try a 2-year-old v6.13, kallsyms shows 'd' as we'd expect. I've
bisected it down to commit cb33ff9e063c ("x86/kexec: Move relocate_kernel
to kernel .data section"), but I still don't know if it's a bug or a feature.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] vsock/test: Do not filter kallsyms by symbol type
  2026-01-16  8:52 [PATCH net] vsock/test: Do not filter kallsyms by symbol type Michal Luczaj
  2026-01-16 10:11 ` Stefano Garzarella
@ 2026-01-20 15:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-01-20 15:50 UTC (permalink / raw)
  To: Michal Luczaj
  Cc: sgarzare, leonardi, kuba, virtualization, netdev, linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Fri, 16 Jan 2026 09:52:36 +0100 you wrote:
> Blamed commit implemented logic to discover available vsock transports by
> grepping /proc/kallsyms for known symbols. It incorrectly filtered entries
> by type 'd'.
> 
> For some kernel configs having
> 
>     CONFIG_VIRTIO_VSOCKETS=m
>     CONFIG_VSOCKETS_LOOPBACK=y
> 
> [...]

Here is the summary with links:
  - [net] vsock/test: Do not filter kallsyms by symbol type
    https://git.kernel.org/netdev/net/c/5d54aa40c7b7

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-20 15:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-16  8:52 [PATCH net] vsock/test: Do not filter kallsyms by symbol type Michal Luczaj
2026-01-16 10:11 ` Stefano Garzarella
2026-01-16 15:54   ` Michal Luczaj
2026-01-20 15:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox