From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:58408 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751347AbdIOGVx (ORCPT ); Fri, 15 Sep 2017 02:21:53 -0400 Subject: Patch "net/mlx5e: Fix dangling page pointer on DMA mapping error" has been added to the 4.12-stable tree To: eranbe@mellanox.com, gregkh@linuxfoundation.org, saeedm@mellanox.com Cc: , From: Date: Thu, 14 Sep 2017 23:21:38 -0700 Message-ID: <1505456498205216@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled net/mlx5e: Fix dangling page pointer on DMA mapping error to the 4.12-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-mlx5e-fix-dangling-page-pointer-on-dma-mapping-error.patch and it can be found in the queue-4.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Thu Sep 14 23:20:23 PDT 2017 From: Eran Ben Elisha Date: Wed, 16 Aug 2017 14:37:11 +0300 Subject: net/mlx5e: Fix dangling page pointer on DMA mapping error From: Eran Ben Elisha [ Upstream commit 0556ce72ab16156af6c94cdc7964e4310acc97c0 ] Function mlx5e_dealloc_rx_wqe is using page pointer value as an indication to valid DMA mapping. In case that the mapping failed, we released the page but kept the dangling pointer. Store the page pointer only after the DMA mapping passed to avoid invalid page DMA unmap. Fixes: bc77b240b3c5 ("net/mlx5e: Add fragmented memory support for RX multi packet WQE") Signed-off-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -216,13 +216,13 @@ static inline int mlx5e_page_alloc_mappe if (unlikely(!page)) return -ENOMEM; - dma_info->page = page; dma_info->addr = dma_map_page(rq->pdev, page, 0, RQ_PAGE_SIZE(rq), rq->buff.map_dir); if (unlikely(dma_mapping_error(rq->pdev, dma_info->addr))) { put_page(page); return -ENOMEM; } + dma_info->page = page; return 0; } Patches currently in stable-queue which might be from eranbe@mellanox.com are queue-4.12/net-mlx5e-fix-dangling-page-pointer-on-dma-mapping-error.patch