From: Paolo Abeni <pabeni@redhat.com>
To: Eddie James <eajames@linux.ibm.com>, sam@mendozajonas.com
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
gwshan@linux.vnet.ibm.com, joel@jms.id.au,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/ncsi: Cancel the ncsi work before freeing the associated structure
Date: Tue, 24 Sep 2024 11:10:40 +0200 [thread overview]
Message-ID: <ba1883f3-7367-47af-a81d-3a59b6d12fea@redhat.com> (raw)
In-Reply-To: <20240917191255.1436553-1-eajames@linux.ibm.com>
On 9/17/24 21:12, Eddie James wrote:
> The work function can run after the ncsi device is freed, resulting
> in use-after-free bugs or kernel panic.
>
> Fixes: 2d283bdd079c ("net/ncsi: Resource management")
> Signed-off-by: Eddie James <eajames@linux.ibm.com>
> ---
> net/ncsi/ncsi-manage.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c
> index 5ecf611c8820..3eda24eac668 100644
> --- a/net/ncsi/ncsi-manage.c
> +++ b/net/ncsi/ncsi-manage.c
> @@ -1954,6 +1954,8 @@ void ncsi_unregister_dev(struct ncsi_dev *nd)
> list_del_rcu(&ndp->node);
> spin_unlock_irqrestore(&ncsi_dev_lock, flags);
>
> + cancel_work_sync(&ndp->work);
Possibly disable_work_sync(), just to be on the safe side?
Thanks,
Paolo
prev parent reply other threads:[~2024-09-24 9:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-17 19:12 Eddie James
2024-09-24 9:10 ` Paolo Abeni [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=ba1883f3-7367-47af-a81d-3a59b6d12fea@redhat.com \
--to=pabeni@redhat.com \
--cc=davem@davemloft.net \
--cc=eajames@linux.ibm.com \
--cc=edumazet@google.com \
--cc=gwshan@linux.vnet.ibm.com \
--cc=joel@jms.id.au \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sam@mendozajonas.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®