From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: Ding Hui <dinghui@sangfor.com.cn>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<intel-wired-lan@lists.osuosl.org>
Cc: <jesse.brandeburg@intel.com>, <keescook@chromium.org>,
<grzegorzx.szczurek@intel.com>, <mateusz.palczewski@intel.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-hardening@vger.kernel.org>,
Donglin Peng <pengdonglin@sangfor.com.cn>,
Huang Cun <huangcun@sangfor.com.cn>
Subject: Re: [PATCH net 1/2] iavf: Fix use-after-free in free_netdev
Date: Tue, 18 Apr 2023 09:50:37 -0700 [thread overview]
Message-ID: <be26a12c-6463-0e3b-9e05-eee8645e7fa6@intel.com> (raw)
In-Reply-To: <20230408140030.5769-2-dinghui@sangfor.com.cn>
On 4/8/2023 7:00 AM, Ding Hui wrote:
> We do netif_napi_add() for all allocated q_vectors[], but potentially
> do netif_napi_del() for part of them, then kfree q_vectors and lefted
> invalid pointers at dev->napi_list.
>
> If num_active_queues is changed to less than allocated q_vectors[] by
> by unexpected, when iavf_remove, we might see UAF in free_netdev like this:
>
> [ 4093.900222] ==================================================================
> [ 4093.900230] BUG: KASAN: use-after-free in free_netdev+0x308/0x390
> [ 4093.900232] Read of size 8 at addr ffff88b4dc145640 by task test-iavf-1.sh/6699
...
> Fix it by letting netif_napi_del() match to netif_napi_add().
>
Should this have a Fixes:?
> Signed-off-by: Ding Hui <dinghui@sangfor.com.cn>
> Cc: Donglin Peng <pengdonglin@sangfor.com.cn>
> CC: Huang Cun <huangcun@sangfor.com.cn>
next prev parent reply other threads:[~2023-04-18 16:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-08 14:00 [PATCH net 0/2] iavf: Fix issues when setting channels concurrency Ding Hui
2023-04-08 14:00 ` [PATCH net 1/2] iavf: Fix use-after-free in free_netdev Ding Hui
2023-04-18 16:02 ` Michal Kubiak
2023-04-18 16:08 ` Michal Kubiak
2023-04-19 0:50 ` Ding Hui
2023-04-18 16:50 ` Tony Nguyen [this message]
2023-04-19 1:00 ` Ding Hui
2023-04-08 14:00 ` [PATCH net 2/2] iavf: Fix out-of-bounds when setting channels on remove Ding Hui
2023-04-18 16:11 ` Michal Kubiak
2023-04-19 0:53 ` Ding Hui
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=be26a12c-6463-0e3b-9e05-eee8645e7fa6@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=dinghui@sangfor.com.cn \
--cc=edumazet@google.com \
--cc=grzegorzx.szczurek@intel.com \
--cc=huangcun@sangfor.com.cn \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jesse.brandeburg@intel.com \
--cc=keescook@chromium.org \
--cc=kuba@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mateusz.palczewski@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pengdonglin@sangfor.com.cn \
/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).