From: "Agarwal, Nikhil" <nikhila@amd.com>
To: Abhijit Gangurde <abhijit.gangurde@amd.com>, gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, michal.simek@amd.com, git@amd.com,
shubhrajyoti.datta@amd.com,
Prasanna Kumar T S M <ptsm@linux.microsoft.com>,
Nipun.Gupta@amd.com, nikhil.agarwal@amd.com
Subject: Re: [PATCH 1/1] cdx: fix use-after-free in cdx_mcdi_process_cmd after timeout
Date: Wed, 12 Aug 2026 17:26:14 +0530 [thread overview]
Message-ID: <db848e25-9734-4548-83c6-ce35a12b35fa@amd.com> (raw)
In-Reply-To: <20260807063609.2413865-1-abhijit.gangurde@amd.com>
Abhijit Gangurde wrote on 8/7/2026 12:06 PM:
> When an MCDI command times out, cdx_mcdi_timeout_cmd() frees the cmd
> via cdx_mcdi_remove_cmd() but does not clear mcdi->seq_held_by[] or
> mcdi->db_held_by. If the firmware responds after the timeout,
> cdx_mcdi_process_cmd() dereferences the freed cmd pointer leading to a
> use-after-free.
>
> clear the seq_held_by and db_held_by in the timeout path, and
> add an extra kref to handle the race where the response arrives
> concurrently with the timeout handler.
>
> Fixes: eb96b740192b ("cdx: add MCDI protocol interface for firmware interaction")
> Co-developed-by: Prasanna Kumar T S M <ptsm@linux.microsoft.com>
> Signed-off-by: Prasanna Kumar T S M <ptsm@linux.microsoft.com>
> Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
> ---
Reviewed-by: Nikhil Agarwal <nikhil.agarwal@amd.com>
prev parent reply other threads:[~2026-08-12 11:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 6:36 Abhijit Gangurde
2026-08-12 11:56 ` Agarwal, Nikhil [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=db848e25-9734-4548-83c6-ce35a12b35fa@amd.com \
--to=nikhila@amd.com \
--cc=Nipun.Gupta@amd.com \
--cc=abhijit.gangurde@amd.com \
--cc=git@amd.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=nikhil.agarwal@amd.com \
--cc=ptsm@linux.microsoft.com \
--cc=shubhrajyoti.datta@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
all inboxes | Powered by JetHome®