mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: linux1394-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] firewire: core: fix race condition in split transaction handling
Date: Sun, 18 Oct 2026 19:30:05 +0900	[thread overview]
Message-ID: <20261018103005.GA346159@sakamocchi.jp> (raw)
In-Reply-To: <20261018025504.290598-1-o-takashi@sakamocchi.jp>

On Sun, Oct 18, 2026 at 11:55:04AM +0900, Takashi Sakamoto wrote:
> For a split transaction, either fw_core_handle_response() or
> split_transaction_timeout_callback() may manipulate the same transaction
> entry in the pending transaction list. The return value of timer_delete()
> is used to determine which function handles the entry. If the transaction
> is a split transaction and timer_delete() returns zero, the timeout
> callback may already be running. In this case, the response handler must
> leave the entry in the list for the timeout callback to remove.
> 
> A previous code refactoring broke this behavior, introducing a race
> condition in which both functions could process the same transaction.
> This could lead to a use-after-free on the transaction initiator side.
> 
> Fix the regression by ensuring that the response handler does not process
> the transaction when timer_delete() returns zero. The timeout callback is
> responsible for removing the entry from the pending transaction list.
> 
> Fixes: fa2dc2710076 ("firewire: core: code refactoring to find and pop transaction entry")
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
> ---
>  drivers/firewire/core-transaction.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

Applied to for-linus branch.


Regards

Takashi Sakamoto

      reply	other threads:[~2026-10-18 10:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-18  2:55 Takashi Sakamoto
2026-10-18 10:30 ` Takashi Sakamoto [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=20261018103005.GA346159@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    /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®