From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by dpdk.org (Postfix) with ESMTP id 020A2C422 for ; Tue, 30 Jun 2015 11:28:23 +0200 (CEST) Received: by wiga1 with SMTP id a1so92741862wig.0 for ; Tue, 30 Jun 2015 02:28:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=lMi28ETRIxsgJ5QiY+0i/Jo0zwNYlga6EJMnKZ6VPJ8=; b=gsJnkZoYGWWlYrmhOxbfX043h9jsCHQ4HaQq6ETFM45u/n6EOd9L71IZz2vB/FXBZk 4k2fgDsJoMjenkEsIPS856mj/wKJoAyWgD+iR7+8AXdTwsCr7jwvDJAF7obcERYUdP3r yG+0N73h5Vq+0EpQ0nkgo9pZy1dc6j6etCFBLRnA2wExNJD5STFXLPR13ITg43xQsK1u GxUSs0IE4viD2LPxjaTmpOvrNuXTYi+wTGbnlqcjV/Y1FHa5fay9+m2ovhsFaEiAToRq xrvNdLmECNtWU8ZE2wVuS3BBjEfmn7tqk1W3Wenz0krqKDWIdWWHudRJ1DVSk8zr6JlS DrNw== X-Gm-Message-State: ALoCoQndkUs/0F2Vs+Vy5b+1O493MmrCCseDnmg1HGQA2mXvz1wSTPCQGCxWZbJFVEENMxQI4Ui0 X-Received: by 10.194.174.194 with SMTP id bu2mr40163116wjc.76.1435656502918; Tue, 30 Jun 2015 02:28:22 -0700 (PDT) Received: from 6wind.com (6wind.net2.nerim.net. [213.41.151.210]) by mx.google.com with ESMTPSA id qq1sm67813940wjc.0.2015.06.30.02.28.21 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 30 Jun 2015 02:28:22 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Tue, 30 Jun 2015 11:27:47 +0200 Message-Id: <1435656489-27986-2-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1435656489-27986-1-git-send-email-adrien.mazarguil@6wind.com> References: <1433546120-2254-1-git-send-email-adrien.mazarguil@6wind.com> <1435656489-27986-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH v2 01/23] mlx4: fix possible crash on scattered mbuf allocation failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 09:28:23 -0000 When failing to allocate a segment, mlx4_rx_burst_sp() may call rte_pktmbuf_free() on an incomplete scattered mbuf whose next pointer in the last segment is not set. Signed-off-by: Adrien Mazarguil --- drivers/net/mlx4/mlx4.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 5391b7a..d1166b2 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -2370,8 +2370,10 @@ mlx4_rx_burst_sp(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) DEBUG("rxq=%p, wr_id=%" PRIu64 ":" " can't allocate a new mbuf", (void *)rxq, wr_id); - if (pkt_buf != NULL) + if (pkt_buf != NULL) { + *pkt_buf_next = NULL; rte_pktmbuf_free(pkt_buf); + } /* Increase out of memory counters. */ ++rxq->stats.rx_nombuf; ++rxq->priv->dev->data->rx_mbuf_alloc_failed; -- 2.1.0