From: Simon Horman <simon.horman@corigine.com>
To: Ding Hui <dinghui@sangfor.com.cn>
Cc: pengdonglin@sangfor.com.cn, keescook@chromium.org,
anthony.l.nguyen@intel.com, jesse.brandeburg@intel.com,
huangcun@sangfor.com.cn, linux-kernel@vger.kernel.org,
grzegorzx.szczurek@intel.com, edumazet@google.com,
intel-wired-lan@lists.osuosl.org,
linux-hardening@vger.kernel.org, netdev@vger.kernel.org,
kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net
Subject: Re: [Intel-wired-lan] [RESEND PATCH net 1/2] iavf: Fix use-after-free in free_netdev
Date: Wed, 19 Apr 2023 07:50:54 +0200 [thread overview]
Message-ID: <ZD+BPjGImmvwVd3G@corigine.com> (raw)
In-Reply-To: <ff2e0a06-abbb-213a-40ed-20c8e8b2f429@sangfor.com.cn>
On Wed, Apr 19, 2023 at 09:11:37AM +0800, Ding Hui wrote:
> On 2023/4/19 3:48, Simon Horman wrote:
> > Hi Ding Hui,
> >
> > On Mon, Apr 17, 2023 at 03:40:15PM +0800, 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
> >
> > nit: lefted -> leave
> >
>
> Thanks, I'll update in v2.
>
> > > invalid pointers at dev->napi_list.
> > >
> > > If num_active_queues is changed to less than allocated q_vectors[] by
> > > unexpected, when iavf_remove, we might see UAF in free_netdev like this:
> > >
>
> ...
>
> > >
> > > Fix it by letting netif_napi_del() match to netif_napi_add().
> > >
> > > Signed-off-by: Ding Hui <dinghui@sangfor.com.cn>
> > > Cc: Donglin Peng <pengdonglin@sangfor.com.cn>
> > > CC: Huang Cun <huangcun@sangfor.com.cn>
> >
> > as this is a fix it probably should have a fixes tag.
> > I wonder if it should be:
> >
> > Fixes: cc0529271f23 ("i40evf: don't use more queues than CPUs")
>
> I don't think so.
> I searched the git log, and found that the mismatched usage was
> introduced since the beginning of i40evf_main.c, so I'll add
>
> Fixes: 5eae00c57f5e ("i40evf: main driver core")
Yes, agreed, that is the right tag.
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
WARNING: multiple messages have this Message-ID (diff)
From: Simon Horman <simon.horman@corigine.com>
To: Ding Hui <dinghui@sangfor.com.cn>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, intel-wired-lan@lists.osuosl.org,
jesse.brandeburg@intel.com, anthony.l.nguyen@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,
pengdonglin@sangfor.com.cn, huangcun@sangfor.com.cn
Subject: Re: [RESEND PATCH net 1/2] iavf: Fix use-after-free in free_netdev
Date: Wed, 19 Apr 2023 07:50:54 +0200 [thread overview]
Message-ID: <ZD+BPjGImmvwVd3G@corigine.com> (raw)
In-Reply-To: <ff2e0a06-abbb-213a-40ed-20c8e8b2f429@sangfor.com.cn>
On Wed, Apr 19, 2023 at 09:11:37AM +0800, Ding Hui wrote:
> On 2023/4/19 3:48, Simon Horman wrote:
> > Hi Ding Hui,
> >
> > On Mon, Apr 17, 2023 at 03:40:15PM +0800, 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
> >
> > nit: lefted -> leave
> >
>
> Thanks, I'll update in v2.
>
> > > invalid pointers at dev->napi_list.
> > >
> > > If num_active_queues is changed to less than allocated q_vectors[] by
> > > unexpected, when iavf_remove, we might see UAF in free_netdev like this:
> > >
>
> ...
>
> > >
> > > Fix it by letting netif_napi_del() match to netif_napi_add().
> > >
> > > Signed-off-by: Ding Hui <dinghui@sangfor.com.cn>
> > > Cc: Donglin Peng <pengdonglin@sangfor.com.cn>
> > > CC: Huang Cun <huangcun@sangfor.com.cn>
> >
> > as this is a fix it probably should have a fixes tag.
> > I wonder if it should be:
> >
> > Fixes: cc0529271f23 ("i40evf: don't use more queues than CPUs")
>
> I don't think so.
> I searched the git log, and found that the mismatched usage was
> introduced since the beginning of i40evf_main.c, so I'll add
>
> Fixes: 5eae00c57f5e ("i40evf: main driver core")
Yes, agreed, that is the right tag.
next prev parent reply other threads:[~2023-04-19 5:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-17 7:40 [Intel-wired-lan] [RESEND PATCH net 0/2] iavf: Fix issues when setting channels concurrency with removing Ding Hui
2023-04-17 7:40 ` Ding Hui
2023-04-17 7:40 ` [Intel-wired-lan] [RESEND PATCH net 1/2] iavf: Fix use-after-free in free_netdev Ding Hui
2023-04-17 7:40 ` Ding Hui
2023-04-18 19:48 ` [Intel-wired-lan] " Simon Horman
2023-04-18 19:48 ` Simon Horman
2023-04-18 19:50 ` [Intel-wired-lan] " Simon Horman
2023-04-18 19:50 ` Simon Horman
2023-04-18 19:52 ` [Intel-wired-lan] " Simon Horman
2023-04-18 19:52 ` Simon Horman
2023-04-19 1:11 ` [Intel-wired-lan] " Ding Hui
2023-04-19 1:11 ` Ding Hui
2023-04-19 5:50 ` Simon Horman [this message]
2023-04-19 5:50 ` Simon Horman
2023-04-17 7:40 ` [Intel-wired-lan] [RESEND PATCH net 2/2] iavf: Fix out-of-bounds when setting channels on remove Ding Hui
2023-04-17 7:40 ` 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=ZD+BPjGImmvwVd3G@corigine.com \
--to=simon.horman@corigine.com \
--cc=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=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 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.