Netdev List
 help / color / mirror / Atom feed
From: Nagamani PV <nagamani@linux.ibm.com>
To: netdev-bot+sashiko@kernel.org
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, wintera@linux.ibm.com,
	aswin@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com,
	agordeev@linux.ibm.com, borntraeger@linux.ibm.com,
	svens@linux.ibm.com, kees@kernel.org, linux-s390@vger.kernel.org,
	netdev@vger.kernel.org, sashiko-bot@kernel.org
Subject: Re: [PATCH net 2/2] s390/ctcm: Fix use-after-free in channel_remove()
Date: Fri, 11 Sep 2026 15:56:51 +0530	[thread overview]
Message-ID: <0df7dbac-725b-436e-bd8a-bb637ed828f4@linux.ibm.com> (raw)
In-Reply-To: <178900839280.219967.3546163075460076479@kernel.org>



On 10/09/26 8:16 AM, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issue(s) to consider:
> 
> Critical: 0 · High: 1 (3) · Medium: 0 · Low: 1
> 
> - [High] channel_remove() (drivers/s390/net/ctcm_main.c:214/216) uses
>   timer_delete_sync() instead of timer_shutdown_sync().
> - [Low] The patch fixes a real use-after-free reachable during device
>   teardown but carries no `Fixes:` tag, so stable maintainers cannot…
> 
> Pre-existing issues:
> - [High] The same fsm_timer/kfree_fsm() UAF pattern that this patch fixes
>   for ch->timer/ch->sweep_timer remains completely unfixed for the…
> - [High] The synchronous cancel was added in channel_remove(), but
>   ctcm_shutdown_device() frees the objects that timer-driven FSM actions…
> - [High] The MPC channel tasklets are killed only after the resources
>   they dereference have been freed.
> 
> --
> 
> [Severity: Low]
> There is no Fixes: tag on this patch. git blame on the two replaced
> fsm_deltimer() calls and the following kfree_fsm(ch->fsm) points at:
> 
>   293d984f0e3604 ("ctcm: infrastructure for replaced ctc driver")
> 
> Could that be added as a Fixes: tag so stable can work out the affected
> range?
> 

Will add in v2:
  Fixes: 293d984f0e36 ("ctcm: infrastructure for replaced ctc driver")
  Cc: stable@vger.kernel.org
 > [Severity: High]
> Does that hold for the MPC case?  timer_delete_sync() leaves
> timer->function intact, so a later fsm_addtimer() simply re-queues the
> timer:
> For ch == priv->channel[CTCM_WRITE], can a sweep callback that has already
> been dispatched on another CPU execute the fsm_addtimer(&wch->timer, ...)
> above after timer_delete_sync(&ch->timer.tl) has returned?  

Pre-existing issue not introduced by this patch.

> 
> [Severity: High]
> This is a pre-existing ordering problem and not something the patch
> introduces, but kfree_fsm(ch->fsm) here runs before the MPC tasklets
> are stopped later in the same function.

Pre-existing issue not introduced by this patch.

> [Severity: High]
> This is a pre-existing gap rather than a regression from this patch, but
> the driver has two more fsm_timer instances with the same kfree_fsm()
> pattern, and neither is cancelled at all in the teardown path.

Pre-existing issue not introduced by this patch.

> 
> [Severity: High]
> Also pre-existing, but related to where the new synchronous cancel sits in
> the overall shutdown ordering.  In ctcm_shutdown_device() the objects the
> channel timer callbacks dereference are freed before channel_remove() runs:
> 

Pre-existing issue not introduced by this patch.

Nagamani


      reply	other threads:[~2026-09-11 10:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07 14:45 [PATCH net 0/2] s390/ctcm: Fix timer bugs in fsm.c Nagamani PV
2026-09-07 14:45 ` [PATCH net 1/2] s390/ctcm: Fix timer corruption in fsm_addtimer() Nagamani PV
2026-09-10  2:46   ` netdev-bot+sashiko
2026-09-11 10:12     ` Nagamani PV
2026-09-07 14:45 ` [PATCH net 2/2] s390/ctcm: Fix use-after-free in channel_remove() Nagamani PV
2026-09-10  2:46   ` netdev-bot+sashiko
2026-09-11 10:26     ` Nagamani PV [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=0df7dbac-725b-436e-bd8a-bb637ed828f4@linux.ibm.com \
    --to=nagamani@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=aswin@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=kees@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sashiko-bot@kernel.org \
    --cc=svens@linux.ibm.com \
    --cc=wintera@linux.ibm.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