DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xing, Beilei" <beilei.xing@intel.com>
To: Stefan Baranoff <sbaranoff@gmail.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] i40evf: potential segfault
Date: Tue, 24 Aug 2021 02:53:07 +0000	[thread overview]
Message-ID: <MN2PR11MB3807618A017130CEB8289DE0F7C59@MN2PR11MB3807.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CAHzKxpZOhV6sJsW7Jo-P1asKWMWVcL0KNxAwQ2YDG6cSZC9nLg@mail.gmail.com>



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Stefan Baranoff
> Sent: Saturday, August 21, 2021 2:18 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] i40evf: potential segfault
> 
> Hi all!
> 
> I was chasing a potential segfault and it appears, if I'm reading this driver
> correctly, that in i40evf_init_vf() the value vf->adapter->eth_dev is never set
> like pf->adapter->eth_dev is in eth_i40e_dev_init().

Good catch.
You can submit the fix according to iavf_dev_init() where adapter->eth_dev is initialized.
Thanks.

> 
> I believe this is leading to a segfault when something like
> i40e_recv_scattered_pkts calls:
> dev = I40E_VSI_TO_ETH_DEV(rxq->vsi); // dev ends up NULL here
> dev->data->rx_mbuf_alloc_failed++; // this generates a NULL pointer
> dereference/segfault
> 
> 
> I'm not completely confident in my understanding of the PF/VF drivers so I
> may be missing something; but we are seeing the segfault on those lines in
> v20.05 at least. I couldn't find a related patch/commit but wanted to check if
> my reasoning was correct before adding this 1 line fix.
> 
> 
> Thanks,
> Stefan Baranoff

      parent reply	other threads:[~2021-08-24  2:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-20 18:18 Stefan Baranoff
2021-08-23  7:54 ` Ferruh Yigit
2021-08-24  2:53 ` Xing, Beilei [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=MN2PR11MB3807618A017130CEB8289DE0F7C59@MN2PR11MB3807.namprd11.prod.outlook.com \
    --to=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=sbaranoff@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 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).