From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CC718A0C4D; Fri, 20 Aug 2021 20:18:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C5944067E; Fri, 20 Aug 2021 20:18:33 +0200 (CEST) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by mails.dpdk.org (Postfix) with ESMTP id 706DD4003E for ; Fri, 20 Aug 2021 20:18:32 +0200 (CEST) Received: by mail-pg1-f178.google.com with SMTP id e7so9976773pgk.2 for ; Fri, 20 Aug 2021 11:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=h4XOw4IsjEN5WS9iMMeFSuwALbA2iWxYC0OoPDklDMk=; b=fBzG9v3PjL1d2AIhJKfjdN2S3CVrsQMuvjvMDac2WPTkHCS9O48pxb052ggVPe/8bi SlK3w+4qHV3cpADHLKjoQhwiWLtevqNHdMjZ4dkvmx3oF1GvVxjSLHtSUJBkk2apvH8n lT6C/DaVqWiEcKPyQunAgSega0xx3QMa2FLni592zMTpWduyL8nsyScBdDbzahmQ2ywS zcHI2fWUBJxjPYfGBldlwbdIa7P/aluX2+dy1znfw2epAF8AekbZUdm1SWskK+O5agQ2 Nt2LrrCZrEhmHrqGqr9jkaXjpgEEA2avH9FvM6XnWL8YxYG84VCNdv4EeZTXw0npDEIm dRGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=h4XOw4IsjEN5WS9iMMeFSuwALbA2iWxYC0OoPDklDMk=; b=rQdKxion7zflfl0BmdyFJ9uqoTzG7ZC+wB1vyN2G2BEFxFe+c6y0NOAewWLkjtKATP Pz9iMHySGDp3N9+j7HsD8YCsjksnQXi4hQNNJS1cyfnkHO/7oTRt9KroKTMRhXkLlr1f s2epOkBsGL7CR8WkArNh2os9mE3cbikcZhkVJJ1MWovi3isKJ6pvniGwXb9e/Lq+lVqc 02omm5l0/Qvpaih1qrloN1nFhG4hPkzsQcW9d4/Hwcl298TKVRcUECIl9OvC3iXoCL+G zNqQG0VFVOpWGb2QzkpZknENvpZupG6u9aJGMr9ufDq+9pJVc2DKDP6Idrdwha1n1KRw 2RrQ== X-Gm-Message-State: AOAM5318tB3xS2RUnnSuhFE6pWM1tcYqEjSpb99dOz65AK9qON4d0wNd lz8mYbHfApp/CoDdpQ7Q0ESRziI3qkq9c0fk17HN1R9jgdo= X-Google-Smtp-Source: ABdhPJyyWkcGOMkYrkwq9urfRs4dnMe3H8pDZeG9EWUJWr8wFDzbBysYGWpEyxoBXy3Gv1ILzXbhk6jAM7GhHCRMrXk= X-Received: by 2002:a05:6a00:24c2:b0:3e2:878d:7e44 with SMTP id d2-20020a056a0024c200b003e2878d7e44mr20103028pfv.22.1629483511438; Fri, 20 Aug 2021 11:18:31 -0700 (PDT) MIME-Version: 1.0 From: Stefan Baranoff Date: Fri, 20 Aug 2021 14:18:20 -0400 Message-ID: To: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-dev] i40evf: potential segfault X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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(). 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