public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* Patch "nfp: fix infinite loop on umapping cleanup" has been added to the 4.12-stable tree
@ 2017-08-25  0:44 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-08-25  0:44 UTC (permalink / raw)
  To: colin.king, davem, gregkh, jakub.kicinski; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    nfp: fix infinite loop on umapping cleanup

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:
     nfp-fix-infinite-loop-on-umapping-cleanup.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 <stable@vger.kernel.org> know about it.


>From foo@baz Thu Aug 24 17:43:45 PDT 2017
From: Colin Ian King <colin.king@canonical.com>
Date: Fri, 18 Aug 2017 12:11:50 +0100
Subject: nfp: fix infinite loop on umapping cleanup

From: Colin Ian King <colin.king@canonical.com>


[ Upstream commit eac2c68d663effb077210218788952b5a0c1f60e ]

The while loop that performs the dma page unmapping never decrements
index counter f and hence loops forever. Fix this with a pre-decrement
on f.

Detected by CoverityScan, CID#1357309 ("Infinite loop")

Fixes: 4c3523623dc0 ("net: add driver for Netronome NFP4000/NFP6000 NIC VFs")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/netronome/nfp/nfp_net_common.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -881,8 +881,7 @@ static int nfp_net_tx(struct sk_buff *sk
 	return NETDEV_TX_OK;
 
 err_unmap:
-	--f;
-	while (f >= 0) {
+	while (--f >= 0) {
 		frag = &skb_shinfo(skb)->frags[f];
 		dma_unmap_page(dp->dev, tx_ring->txbufs[wr_idx].dma_addr,
 			       skb_frag_size(frag), DMA_TO_DEVICE);


Patches currently in stable-queue which might be from colin.king@canonical.com are

queue-4.12/nfp-fix-infinite-loop-on-umapping-cleanup.patch
queue-4.12/irda-do-not-leak-initialized-list.dev-to-userspace.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-25  0:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-25  0:44 Patch "nfp: fix infinite loop on umapping cleanup" has been added to the 4.12-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox