From: Sabrina Dubroca <sd@queasysnail.net>
To: Mark Bloch <mbloch@nvidia.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Kuniyuki Iwashima <kuniyu@amazon.com>,
Leon Romanovsky <leon@kernel.org>,
David Ahern <dsahern@kernel.org>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
Mark Zhang <markzhang@nvidia.com>,
Maher Sanalla <msanalla@nvidia.com>
Subject: Re: [PATCH v2 net] rtnetlink: Allocate vfinfo size for VF GUIDs when supported
Date: Tue, 25 Mar 2025 16:49:07 +0100 [thread overview]
Message-ID: <Z-LQcyC8DU7Wny-d@krikkit> (raw)
In-Reply-To: <20250325090226.749730-1-mbloch@nvidia.com>
2025-03-25, 11:02:26 +0200, Mark Bloch wrote:
> From: Mark Zhang <markzhang@nvidia.com>
>
> Commit 30aad41721e0 ("net/core: Add support for getting VF GUIDs")
> added support for getting VF port and node GUIDs in netlink ifinfo
> messages, but their size was not taken into consideration in the
> function that allocates the netlink message, causing the following
> warning when a netlink message is filled with many VF port and node
> GUIDs:
> # echo 64 > /sys/bus/pci/devices/0000\:08\:00.0/sriov_numvfs
> # ip link show dev ib0
> RTNETLINK answers: Message too long
> Cannot send link get request: Message too long
>
> Kernel warning:
>
> ------------[ cut here ]------------
> WARNING: CPU: 2 PID: 1930 at net/core/rtnetlink.c:4151 rtnl_getlink+0x586/0x5a0
> Modules linked in: xt_conntrack xt_MASQUERADE nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter overlay mlx5_ib macsec mlx5_core tls rpcrdma rdma_ucm ib_uverbs ib_iser libiscsi scsi_transport_iscsi ib_umad rdma_cm iw_cm ib_ipoib fuse ib_cm ib_core
> CPU: 2 UID: 0 PID: 1930 Comm: ip Not tainted 6.14.0-rc2+ #1
> Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
> RIP: 0010:rtnl_getlink+0x586/0x5a0
> Code: cb 82 e8 3d af 0a 00 4d 85 ff 0f 84 08 ff ff ff 4c 89 ff 41 be ea ff ff ff e8 66 63 5b ff 49 c7 07 80 4f cb 82 e9 36 fc ff ff <0f> 0b e9 16 fe ff ff e8 de a0 56 00 66 66 2e 0f 1f 84 00 00 00 00
> RSP: 0018:ffff888113557348 EFLAGS: 00010246
> RAX: 00000000ffffffa6 RBX: ffff88817e87aa34 RCX: dffffc0000000000
> RDX: 0000000000000003 RSI: 0000000000000000 RDI: ffff88817e87afb8
> RBP: 0000000000000009 R08: ffffffff821f44aa R09: 0000000000000000
> R10: ffff8881260f79a8 R11: ffff88817e87af00 R12: ffff88817e87aa00
> R13: ffffffff8563d300 R14: 00000000ffffffa6 R15: 00000000ffffffff
> FS: 00007f63a5dbf280(0000) GS:ffff88881ee00000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 00007f63a5ba4493 CR3: 00000001700fe002 CR4: 0000000000772eb0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> PKRU: 55555554
> Call Trace:
> <TASK>
> ? __warn+0xa5/0x230
> ? rtnl_getlink+0x586/0x5a0
> ? report_bug+0x22d/0x240
> ? handle_bug+0x53/0xa0
> ? exc_invalid_op+0x14/0x50
> ? asm_exc_invalid_op+0x16/0x20
> ? skb_trim+0x6a/0x80
> ? rtnl_getlink+0x586/0x5a0
> ? __pfx_rtnl_getlink+0x10/0x10
> ? rtnetlink_rcv_msg+0x1e5/0x860
> ? __pfx___mutex_lock+0x10/0x10
> ? rcu_is_watching+0x34/0x60
> ? __pfx_lock_acquire+0x10/0x10
> ? stack_trace_save+0x90/0xd0
> ? filter_irq_stacks+0x1d/0x70
> ? kasan_save_stack+0x30/0x40
> ? kasan_save_stack+0x20/0x40
> ? kasan_save_track+0x10/0x30
> rtnetlink_rcv_msg+0x21c/0x860
[...]
> ---[ end trace 0000000000000000 ]---
>
> Thus, when calculating ifinfo message size, take VF GUIDs sizes into
> account when supported.
>
> Fixes: 30aad41721e0 ("net/core: Add support for getting VF GUIDs")
> Signed-off-by: Mark Zhang <markzhang@nvidia.com>
> Reviewed-by: Maher Sanalla <msanalla@nvidia.com>
> Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
--
Sabrina
next prev parent reply other threads:[~2025-03-25 15:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-25 9:02 [PATCH v2 net] rtnetlink: Allocate vfinfo size for VF GUIDs when supported Mark Bloch
2025-03-25 15:49 ` Sabrina Dubroca [this message]
2025-03-27 18:50 ` patchwork-bot+netdevbpf
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=Z-LQcyC8DU7Wny-d@krikkit \
--to=sd@queasysnail.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@amazon.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=markzhang@nvidia.com \
--cc=mbloch@nvidia.com \
--cc=msanalla@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).