From: Simon Horman <horms@kernel.org>
To: Wong Boon Jhee <wongboonjhee52@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] net/ncsi: Fix Use-After-Free in ncsi_remove_channel/package
Date: Fri, 14 Aug 2026 15:18:32 +0100 [thread overview]
Message-ID: <20260814141832.GO265046@horms.kernel.org> (raw)
In-Reply-To: <CAOvhtVvk+HmPeyT94dumkmf2U-O032esD-hRmj2yp12gyUvMTw@mail.gmail.com>
On Thu, Aug 13, 2026 at 12:29:42AM +0800, Wong Boon Jhee wrote:
> From af39fbef05b309b7e183690dbb7e63295ff0be5a Mon Sep 17 00:00:00 2001
> From: Wong Boon Jhee <wongboonjhee52@gmail.com>
> Date: Thu, 13 Aug 2026 00:25:47 +0800
> Subject: [PATCH] net/ncsi: Fix Use-After-Free in NCSI channel and package
> removal
>
> In net/ncsi/ncsi-manage.c, ncsi_remove_channel() and
> ncsi_remove_package() remove objects from an RCU-protected linked list
> using list_del_rcu() and immediately free them using kfree().
>
> Because there is no call to synchronize_rcu() or kfree_rcu(), concurrent
> readers traversing these lists under rcu_read_lock() (such as Netlink
> dump handlers) can still hold a valid pointer to the object. When kfree()
> executes, the reader is left holding a dangling pointer to freed memory,
> resulting in a slab-use-after-free.
>
> This patch fixes the issue by replacing kfree() with kfree_rcu(), which
> defers the memory freeing until all pre-existing RCU readers have finished
> their critical sections. To support this, a struct rcu_head has been
> added to struct ncsi_channel, struct ncsi_package, and struct ncsi_dev_priv.
>
> KASAN confirms the freed object belongs to the kmalloc-96 cache, and the
> fix completely eliminates the crash.
>
> Fixes: 2d283bdd079c ("net/ncsi: Resource management")
> Signed-off-by: Wong Boon Jhee <wongboonjhee52@gmail.com>
Thanks for your patch.
Unfortunately, it does not seem to apply.
Please:
1. Rebase the patch on the current net tree
2. Target that tree when you resubmit the patch
Subject: [PATCH net v2] ...
3. Include a changelog that describes this change
The b4 tool can help you.
--
pw-bot: changes-requested
prev parent reply other threads:[~2026-08-14 14:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 16:29 [PATCH] net/ncsi: Fix Use-After-Free in ncsi_remove_channel/package Wong Boon Jhee
2026-08-14 14:18 ` Simon Horman [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=20260814141832.GO265046@horms.kernel.org \
--to=horms@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=wongboonjhee52@gmail.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 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.