From: David Miller <davem@davemloft.net>
To: bruceshenzk@gmail.com
Cc: jcliburn@gmail.com, chris.snook@gmail.com, kuba@kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] net: alx: fix race condition in alx_remove
Date: Mon, 15 Jun 2020 13:20:31 -0700 (PDT) [thread overview]
Message-ID: <20200615.132031.260816488025362367.davem@davemloft.net> (raw)
In-Reply-To: <20200615155029.21002-1-bruceshenzk@gmail.com>
From: Zekun Shen <bruceshenzk@gmail.com>
Date: Mon, 15 Jun 2020 11:50:29 -0400
> There is a race condition exist during termination. The path is
> alx_stop and then alx_remove. An alx_schedule_link_check could be called
> before alx_stop by interrupt handler and invoke alx_link_check later.
> Alx_stop frees the napis, and alx_remove cancels any pending works.
> If any of the work is scheduled before termination and invoked before
> alx_remove, a null-ptr-deref occurs because both expect alx->napis[i].
>
> This patch fix the race condition by moving cancel_work_sync functions
> before alx_free_napis inside alx_stop. Because interrupt handler can call
> alx_schedule_link_check again, alx_free_irq is moved before
> cancel_work_sync calls too.
>
> Signed-off-by: Zekun Shen <bruceshenzk@gmail.com>
Applied, thank you.
prev parent reply other threads:[~2020-06-15 20:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-14 16:59 [PATCH] net: alx: fix race condition in alx_remove Zekun Shen
2020-06-15 15:50 ` [PATCH v2] " Zekun Shen
2020-06-15 20:20 ` David Miller [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=20200615.132031.260816488025362367.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=bruceshenzk@gmail.com \
--cc=chris.snook@gmail.com \
--cc=jcliburn@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).