From: Moshe Shemesh <moshe@nvidia.com>
To: Usama Arif <usamaarif642@gmail.com>,
Breno Leitao <leitao@debian.org>, <saeedm@nvidia.com>,
<itayavr@nvidia.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<dcostantino@meta.com>, <kuba@kernel.org>
Subject: Re: mlx5: CX7: fw_tracer: crash at mlx5_tracer_print_trace()
Date: Tue, 4 Nov 2025 14:09:52 +0200 [thread overview]
Message-ID: <f04438b5-2f62-498b-91f4-07085f46d6b9@nvidia.com> (raw)
In-Reply-To: <0c2cc197-f540-4842-a807-3f11d2ae632a@gmail.com>
On 11/3/2025 12:45 PM, Usama Arif wrote:
> On 15/10/2025 12:13, Moshe Shemesh wrote:
>>
>>
>> On 10/9/2025 3:42 PM, Breno Leitao wrote:
>>> Hello,
>>>
>>> I am seeing a crash in some production host in function
>>> mlx5_tracer_print_trace() that sprintf a string (%s) pointing to value
>>> that doesn't seem to be addressable. I am seeing this on 6.13, but,
>>> looking at the upstream code, the function is the same.
>>>
>>> Unfortunately I am not able to reproduce this on upstream kernel easily.
>>> Host is running ConnectX-7.
>>>
>>> Here is the quick stack of the problem:
>>>
>>> Unable to handle kernel paging request at virtual address 00000000213afe58
>>>
>>> #0 string_nocheck(buf=0xffff8002a11af909[vmap stack: 1315725 (kworker/u576:1) +0xf909], end=0xffff8002a11afae0[vmap stack: 1315725 (kworker/u576:1) +0xfae0], s=0x213afe59, len=0) (lib/vsprintf.c:646:12)
>>> #1 string(end=0xffff8002a11afae0[vmap stack: 1315725 (kworker/u576:1) +0xfae0], s=0x213afe58) (lib/vsprintf.c:728:9)
>>> #2 vsnprintf(buf=0xffff8002a11af8e0[vmap stack: 1315725 (kworker/u576:1) +0xf8e0], fmt=0xffff10006cd4950a, end=0xffff8002a11afae0[vmap stack: 1315725 (kworker/u576:1) +0xfae0], str=0xffff8002a11af909[vmap stack: 1315725 (kworker/u576:1) +0xf909], old_fmt=0xffff10006cd49508) (lib/vsprintf.c:2848:10)
>>> #3 snprintf (lib/vsprintf.c:2983:6)
>>>
>>> Looking further, I found this code:
>>>
>>> snprintf(tmp, sizeof(tmp), str_frmt->string,
>>> str_frmt->params[0],
>>> str_frmt->params[1],
>>> str_frmt->params[2],
>>> str_frmt->params[3],
>>> str_frmt->params[4],
>>> str_frmt->params[5],
>>> str_frmt->params[6]);
>>>
>>>
>>> and the str_frmt has the following content:
>>>
>>> *(struct tracer_string_format *)0xffff100026547260 = {
>>> .string = (char *)0xffff10006cd494df = "PCA 9655E init, failed to verify command %s, failed %d",
>>> .params = (int [7]){ 557514328, 3 },
>>> .num_of_params = (int)2,
>>> .last_param_num = (int)2,
>>> .event_id = (u8)3,
>>> .tmsn = (u32)5201,
>>> .hlist = (struct hlist_node){
>>> .next = (struct hlist_node *)0xffff0009f63ce078,
>>> .pprev = (struct hlist_node **)0xffff0004123ec8d8,
>>> },
>>> .list = (struct list_head){
>>> .next = (struct list_head *)0xdead000000000100,
>>> .prev = (struct list_head *)0xdead000000000122,
>>> },
>>> .timestamp = (u32)22,
>>> .lost = (bool)0,
>>> }
>>>
>>>
>>> My understanding that we are printf %s with params[0], which is 557514328 (aka
>>> 0x213afe58). So, sprintf is trying to access the content of 0x213afe58, which
>>> is invalid, and crash.
>>>
>>> Is this a known issue?
>>>
>>
>> Not a known issue, not expected, thanks for reporting.
>> We will send patch to protect from such crash.
>> Please send FW version it was detected on.
>
> Hello!
>
> I work with Breno and just following up on his behalf while he is away. Just wanted to check
> if there was an update on the patch?
>
Hi, patch is currently in internal review.
Thanks,
Moshe.
> Thanks
> Usama
>>
>> Thanks,
>> Moshe.
>>
>>> Thanks
>>> --breno
>>>
>>
>
prev parent reply other threads:[~2025-11-04 12:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-09 12:42 Breno Leitao
2025-10-15 9:13 ` Moshe Shemesh
2025-10-15 12:26 ` Breno Leitao
2025-10-16 15:39 ` Moshe Shemesh
2025-11-03 10:45 ` Usama Arif
2025-11-04 12:09 ` Moshe Shemesh [this message]
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=f04438b5-2f62-498b-91f4-07085f46d6b9@nvidia.com \
--to=moshe@nvidia.com \
--cc=dcostantino@meta.com \
--cc=itayavr@nvidia.com \
--cc=kuba@kernel.org \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.com \
--cc=usamaarif642@gmail.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
all inboxes | Powered by JetHome®