From nobody Tue Nov 11 09:03:35 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1565019368; cv=none; d=zoho.com; s=zohoarc; b=ctqbiRFRON914m7yDXEMe2ZPdxO0IAkJObtfIbHThOjvSX5RZqCnVnF+X8QM1Xgi3qlUSTwu4t8oSbN4SNAMtP+dQKEPGmof0Yrs+9QKbbtXtoS0jgucp7r0Gpf3CwPbRLRGQzqC4YRBb3iZelHGEELGD6gkebUOz2gj/Fzfzxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565019368; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=OzhfuzY6sPwGAhy30aqckubGeFc2+1NCgXbmrDw+4DQ=; b=KoR5tQ2w0TMUWStxavu/83WFS0RJtiQeOKdMgzB+AadJeAX2GRjrfAGo57lQsDsazqqmB/XoFxc3m7PAbfz3JGDaCP59ZiimE0KXKiEQgP79uZfMnfpStjLcaKkfwSPC6xfgjEodEMIXIoI283HA49c9ckk859NfagCTkLq2T+8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1565019368781147.89167635284866; Mon, 5 Aug 2019 08:36:08 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1huf0U-0006uj-Uh; Mon, 05 Aug 2019 15:34:42 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1huf0U-0006ue-1B for xen-devel@lists.xenproject.org; Mon, 05 Aug 2019 15:34:42 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8950a0ba-b796-11e9-8e5d-439c75b3fe30; Mon, 05 Aug 2019 15:34:39 +0000 (UTC) X-Inumbo-ID: 8950a0ba-b796-11e9-8e5d-439c75b3fe30 Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=ross.lagerwall@citrix.com; spf=Pass smtp.mailfrom=ross.lagerwall@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of ross.lagerwall@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="ross.lagerwall@citrix.com"; x-sender="ross.lagerwall@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of ross.lagerwall@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="ross.lagerwall@citrix.com"; x-sender="ross.lagerwall@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="ross.lagerwall@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: MG3ZYEtER2WNBLk7cKJNOdkkcuRS1CfcERDgx+KKeOAZ18birOSwVaDoGmN6J5wHyqDQuNDlPo 2NMP/2mVtpyvDFsDetJxnpfrW62aypu0V88gQNBuncwFTW4ERaK4LcQ5Yim3TVEPVBLsctvPNu POCTx4WHjJdznFWGZlWrdXHDb9DPv4N3W4CvLmcgUI+QW2gyVvI6JEeLWS+x7lTTyC2SXUqAP9 nQ+DN+jzSXNcFnY+rTEx8Fdt+FA34PQ0zoc7N8tZJPVjhAojTm1my0ZBmZCZd918eQxIJ1kxWk hv8= X-SBRS: 2.7 X-MesageID: 3880647 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,350,1559534400"; d="scan'208";a="3880647" From: Ross Lagerwall To: Date: Mon, 5 Aug 2019 16:34:34 +0100 Message-ID: <20190805153434.12144-1-ross.lagerwall@citrix.com> X-Mailer: git-send-email 2.17.2 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] xen/netback: Reset nr_frags before freeing skb X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: xen-devel@lists.xenproject.org, Wei Liu , Paul Durrant , "David S. Miller" , Ross Lagerwall Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" At this point nr_frags has been incremented but the frag does not yet have a page assigned so freeing the skb results in a crash. Reset nr_frags before freeing the skb to prevent this. Signed-off-by: Ross Lagerwall --- drivers/net/xen-netback/netback.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/ne= tback.c index 1d9940d4e8c7..c9262ffeefe4 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -925,6 +925,7 @@ static void xenvif_tx_build_gops(struct xenvif_queue *q= ueue, skb_shinfo(skb)->nr_frags =3D MAX_SKB_FRAGS; nskb =3D xenvif_alloc_skb(0); if (unlikely(nskb =3D=3D NULL)) { + skb_shinfo(skb)->nr_frags =3D 0; kfree_skb(skb); xenvif_tx_err(queue, &txreq, extra_count, idx); if (net_ratelimit()) @@ -940,6 +941,7 @@ static void xenvif_tx_build_gops(struct xenvif_queue *q= ueue, =20 if (xenvif_set_skb_gso(queue->vif, skb, gso)) { /* Failure in xenvif_set_skb_gso is fatal. */ + skb_shinfo(skb)->nr_frags =3D 0; kfree_skb(skb); kfree_skb(nskb); break; --=20 2.17.2 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel