* [PATCH] xen/netfront: tolerate frags with no data
@ 2018-12-18 15:06 Juergen Gross
2018-12-19 6:00 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Juergen Gross @ 2018-12-18 15:06 UTC (permalink / raw)
To: linux-kernel, netdev, xen-devel
Cc: davem, sstabellini, boris.ostrovsky, Juergen Gross, stable
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.
Cc: stable@vger.kernel.org
Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
drivers/net/xen-netfront.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index f17f602e6171..5b97cc946d70 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -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)) {
--
2.16.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xen/netfront: tolerate frags with no data
2018-12-18 15:06 [PATCH] xen/netfront: tolerate frags with no data Juergen Gross
@ 2018-12-19 6:00 ` David Miller
2018-12-19 6:02 ` Juergen Gross
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2018-12-19 6:00 UTC (permalink / raw)
To: jgross
Cc: linux-kernel, netdev, xen-devel, sstabellini, boris.ostrovsky, stable
From: Juergen Gross <jgross@suse.com>
Date: Tue, 18 Dec 2018 16:06:19 +0100
> 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 <dietmar.hahn@ts.fujitsu.com>
> Signed-off-by: Juergen Gross <jgross@suse.com>
Applied and queued up for -stable.
But many of these BUG's in the driver should be converted to
WARNs and recovery code added.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xen/netfront: tolerate frags with no data
2018-12-19 6:00 ` David Miller
@ 2018-12-19 6:02 ` Juergen Gross
0 siblings, 0 replies; 3+ messages in thread
From: Juergen Gross @ 2018-12-19 6:02 UTC (permalink / raw)
To: David Miller
Cc: linux-kernel, netdev, xen-devel, sstabellini, boris.ostrovsky, stable
On 19/12/2018 07:00, David Miller wrote:
> From: Juergen Gross <jgross@suse.com>
> Date: Tue, 18 Dec 2018 16:06:19 +0100
>
>> 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 <dietmar.hahn@ts.fujitsu.com>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-12-19 6:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-18 15:06 [PATCH] xen/netfront: tolerate frags with no data Juergen Gross
2018-12-19 6:00 ` David Miller
2018-12-19 6:02 ` Juergen Gross
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).