From: Jakub Kicinski <kuba@kernel.org>
To: Shannon Nelson <shannon.nelson@amd.com>
Cc: <andrew+netdev@lunn.ch>, <brett.creeley@amd.com>,
<davem@davemloft.net>, <edumazet@google.com>, <pabeni@redhat.com>,
<michal.swiatkowski@linux.intel.com>, <horms@kernel.org>,
<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>
Subject: Re: [PATCH v3 net 4/4] pds_core: make wait_context part of q_info
Date: Thu, 17 Apr 2025 08:21:56 -0700 [thread overview]
Message-ID: <20250417082156.5eac67e8@kernel.org> (raw)
In-Reply-To: <20250415232931.59693-5-shannon.nelson@amd.com>
On Tue, 15 Apr 2025 16:29:31 -0700 Shannon Nelson wrote:
> Make the wait_context a full part of the q_info struct rather
> than a stack variable that goes away after pdsc_adminq_post()
> is done so that the context is still available after the wait
> loop has given up.
>
> There was a case where a slow development firmware caused
> the adminq request to time out, but then later the FW finally
> finished the request and sent the interrupt. The handler tried
> to complete_all() the completion context that had been created
> on the stack in pdsc_adminq_post() but no longer existed.
> This caused bad pointer usage, kernel crashes, and much wailing
> and gnashing of teeth.
The patch will certainly redirect the access from the stack.
But since you're already processing the completions under a spin
lock, is it not possible to safely invalidate the completion
under the same lock on timeout?
Perhaps not I haven't looked very closely.
> + wc = &pdsc->adminqcq.q.info[index].wc;
> + wc->wait_completion = COMPLETION_INITIALIZER_ONSTACK(wc->wait_completion);
_ONSTACK you say? I don't think it's on the stack any more.
next prev parent reply other threads:[~2025-04-17 15:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-15 23:29 [PATCH v3 net 0/4] pds_core: updates and fixes Shannon Nelson
2025-04-15 23:29 ` [PATCH v3 net 1/4] pds_core: Prevent possible adminq overflow/stuck condition Shannon Nelson
2025-04-16 20:13 ` Jacob Keller
2025-04-16 20:49 ` Nelson, Shannon
2025-04-16 23:34 ` Jacob Keller
2025-04-15 23:29 ` [PATCH v3 net 2/4] pds_core: handle unsupported PDS_CORE_CMD_FW_CONTROL result Shannon Nelson
2025-04-16 20:14 ` Jacob Keller
2025-04-15 23:29 ` [PATCH v3 net 3/4] pds_core: Remove unnecessary check in pds_client_adminq_cmd() Shannon Nelson
2025-04-16 20:15 ` Jacob Keller
2025-04-15 23:29 ` [PATCH v3 net 4/4] pds_core: make wait_context part of q_info Shannon Nelson
2025-04-16 20:16 ` Jacob Keller
2025-04-17 15:21 ` Jakub Kicinski [this message]
2025-04-18 22:31 ` Nelson, Shannon
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=20250417082156.5eac67e8@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=brett.creeley@amd.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.swiatkowski@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shannon.nelson@amd.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).