Skip to content

Commit 8a288bd

Browse files
jgross1jfvogel
authored andcommitted
xen/netfront: tolerate frags with no data
[ Upstream commit d81c505 ] 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. Tested-by: Dietmar Hahn <[email protected]> Signed-off-by: Juergen Gross <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit f033fba) Orabug: 29632145 Signed-off-by: Calum Mackay <[email protected]> Tested-by: Saar Maoz <[email protected]> Reviewed-by: John Haxby <[email protected]>
1 parent f8f4945 commit 8a288bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/xen-netfront.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ static RING_IDX xennet_fill_frags(struct netfront_queue *queue,
11411141
if (skb_shinfo(skb)->nr_frags == MAX_SKB_FRAGS) {
11421142
unsigned int pull_to = NETFRONT_SKB_CB(skb)->pull_to;
11431143

1144-
BUG_ON(pull_to <= skb_headlen(skb));
1144+
BUG_ON(pull_to < skb_headlen(skb));
11451145
__pskb_pull_tail(skb, pull_to - skb_headlen(skb));
11461146
}
11471147
if (unlikely(skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS)) {

0 commit comments

Comments
 (0)