All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boyan Liu <yymhvert@gmail.com>
To: sashiko-bot@kernel.org
Cc: Boyan Liu <yymhvert@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	co+02480a85e1a0d4f5@bugs.sh
Subject: Re: [PATCH] usb: gadget: f_ncm: Fix use-after-free in ncm_wrap_ntb()
Date: Thu, 22 Oct 2026 22:08:07 +0800	[thread overview]
Message-ID: <20261022140808.18287-1-yymhvert@gmail.com> (raw)
In-Reply-To: <sashiko-outbox-172189@kernel.org>

Hi,

Both findings are real bugs, but both predate this patch; the
use-after-free fix itself is unaffected.

[High] ncm->netdev NULL dereference in the err: path: agreed, the
window exists -- ncm_disable() clears ncm->netdev locklessly, and
ncm_tx_timeout() already treats it as possibly NULL (READ_ONCE +
check). It additionally needs an alloc_skb() failure inside that
window, so the race is narrow. Pre-existing; a fix (guard the stats
update in the err: path, or move the clear after
gether_disconnect()) can be sent separately and does not block this
patch.

[Medium] skb2 leak in the err: path: agreed, also pre-existing.
Since this patch already rewrites that block, I can fold

	if (skb2)
		dev_kfree_skb_any(skb2);

into a v2, or it can go as a separate follow-up -- whichever Greg
prefers.

Thanks,
Boyan

  reply	other threads:[~2026-10-22 14:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15  2:45 [PATCH] usb: gadget: f_ncm: Fix use-after-free in ncm_wrap_ntb() Boyan Liu
2026-10-15  3:00 ` sashiko-bot
2026-10-22 14:08   ` Boyan Liu [this message]
2026-11-06  7:09 ` Boyan Liu
2026-11-20 12:42   ` Greg Kroah-Hartman

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=20261022140808.18287-1-yymhvert@gmail.com \
    --to=yymhvert@gmail.com \
    --cc=co+02480a85e1a0d4f5@bugs.sh \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sashiko-bot@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.