Skip to contentSkip to conversation

Patch "nfp: fix infinite loop on umapping cleanup" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Aug 25, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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.9-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.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Thu Aug 24 17:44:02 PDT 2017

From: Colin Ian King <[email protected]>
Date: Fri, 18 Aug 2017 12:11:50 +0100
Subject: nfp: fix infinite loop on umapping cleanup

From: Colin Ian King <[email protected]>

[ 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")
---
 drivers/net/ethernet/netronome/nfp/nfp_net_common.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/netronome/nfp/nfp_net_common.c +1 -2
@@ -871,8 +871,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(&nn->pdev->dev,
 			       tx_ring->txbufs[wr_idx].dma_addr,

Patches currently in stable-queue which might be from [email protected] are

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