Skip to contentSkip to conversation

Patch "net/xen-netback: off by one in BUG_ON() condition" has been added to the 4.1-stable tree

PATCH [email protected] 1 participant 1 message Sep 26, 2015

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

net/xen-netback: off by one in BUG_ON() condition

to the 4.1-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-xen-netback-off-by-one-in-bug_on-condition.patch
and it can be found in the queue-4.1 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 Sat Sep 26 11:13:07 PDT 2015

From: Dan Carpenter <[email protected]>
Date: Sun, 12 Jul 2015 01:20:55 +0300
Subject: net/xen-netback: off by one in BUG_ON() condition

From: Dan Carpenter <[email protected]>

[ Upstream commit 50c2e4dd6749725338621fff456b26d3a592259f ]

The > should be >=. I also added spaces around the '-' operations so the code is a little more consistent and matches the condition better.

Fixes f53c3fe8dad7 ('xen-netback: Introduce TX grant mapping')
---
 drivers/net/xen-netback/netback.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/xen-netback/netback.c +3 -3
@@ -1571,13 +1571,13 @@ static inline void xenvif_tx_dealloc_act
 		smp_rmb();
 
 		while (dc != dp) {
-			BUG_ON(gop - queue->tx_unmap_ops > MAX_PENDING_REQS);
+			BUG_ON(gop - queue->tx_unmap_ops >= MAX_PENDING_REQS);
 			pending_idx =
 				queue->dealloc_ring[pending_index(dc++)];
 
-			pending_idx_release[gop-queue->tx_unmap_ops] =
+			pending_idx_release[gop - queue->tx_unmap_ops] =
 				pending_idx;
-			queue->pages_to_unmap[gop-queue->tx_unmap_ops] =
+			queue->pages_to_unmap[gop - queue->tx_unmap_ops] =
 				queue->mmap_pages[pending_idx];
 			gnttab_set_unmap_op(gop,
 					    idx_to_kaddr(queue, pending_idx),

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

queue-4.1/rds-fix-an-integer-overflow-test-in-rds_info_getsockopt.patch queue-4.1/net-xen-netback-off-by-one-in-bug_on-condition.patch queue-4.1/packet-missing-dev_put-in-packet_do_bind.patch