Skip to contentSkip to conversation

xen/netfront: tolerate frags with no data

PATCH In review Juergen Gross 2 participants 5 messages Dec 18, 2018 – Dec 19, 2018

Subsystems (4)
lore
Share & tools
lore

Juergen Gross

author maintainer
#0 lore raw

PATCH 1/1 xen/netfront: tolerate frags with no data

At least old Xen net backends seem to send frags with no real data sometimes. In case such a fragment happens to occur with the frag limit already reached the frontend will BUG currently even if this situation is easily recoverable.

Modify the BUG_ON() condition accordingly.

---
 drivers/net/xen-netfront.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/xen-netfront.c +1 -1
index f17f602e6171..5b97cc946d70 100644
@@ -905,7 +905,7 @@ static RING_IDX xennet_fill_frags(struct netfront_queue *queue,
 		if (skb_shinfo(skb)->nr_frags == MAX_SKB_FRAGS) {
 			unsigned int pull_to = NETFRONT_SKB_CB(skb)->pull_to;
 
-			BUG_ON(pull_to <= skb_headlen(skb));
+			BUG_ON(pull_to < skb_headlen(skb));
 			__pskb_pull_tail(skb, pull_to - skb_headlen(skb));
 		}
 		if (unlikely(skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS)) {
Signature · 1 line
2.16.4
maintainer
#1 lore raw

From: Juergen Gross <[email protected]>
Date: Tue, 18 Dec 2018 16:06:19 +0100

Quoted 9 lines

At least old Xen net backends seem to send frags with no real data sometimes. In case such a fragment happens to occur with the frag limit already reached the frontend will BUG currently even if this situation is easily recoverable.

Modify the BUG_ON() condition accordingly.

Applied and queued up for -stable.

But many of these BUG's in the driver should be converted to WARNs and recovery code added.

author maintainer
#2 lore raw
Quoted 10 lines · David Miller

From: Juergen Gross <[email protected]>
Date: Tue, 18 Dec 2018 16:06:19 +0100

Quoted 7 lines

At least old Xen net backends seem to send frags with no real data sometimes. In case such a fragment happens to occur with the frag limit already reached the frontend will BUG currently even if this situation is easily recoverable.

Modify the BUG_ON() condition accordingly.

Quoted 8 lines
Quoted 2 lines

Applied and queued up for -stable.

But many of these BUG's in the driver should be converted to WARNs and recovery code added.

Right, but that will be no stable material then. Will start that effort after Christmas.

Juergen

author maintainer
#3 lore raw
In reply to David Miller
Quoted 10 lines · David Miller

From: Juergen Gross <[email protected]>
Date: Tue, 18 Dec 2018 16:06:19 +0100

Quoted 7 lines

At least old Xen net backends seem to send frags with no real data sometimes. In case such a fragment happens to occur with the frag limit already reached the frontend will BUG currently even if this situation is easily recoverable.

Modify the BUG_ON() condition accordingly.

Quoted 8 lines
Quoted 2 lines

Applied and queued up for -stable.

But many of these BUG's in the driver should be converted to WARNs and recovery code added.

Right, but that will be no stable material then. Will start that effort after Christmas.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

maintainer
#4 lore raw
In reply to Juergen Gross

From: Juergen Gross <[email protected]>
Date: Tue, 18 Dec 2018 16:06:19 +0100

Quoted 9 lines

At least old Xen net backends seem to send frags with no real data sometimes. In case such a fragment happens to occur with the frag limit already reached the frontend will BUG currently even if this situation is easily recoverable.

Modify the BUG_ON() condition accordingly.

Applied and queued up for -stable.

But many of these BUG's in the driver should be converted to WARNs and recovery code added.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel