linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/netfront: don't cache skb_shinfo()
@ 2018-08-09 14:42 Juergen Gross
  2018-08-09 14:47 ` [Xen-devel] " Wei Liu
  2018-08-11 16:42 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Juergen Gross @ 2018-08-09 14:42 UTC (permalink / raw)
  To: linux-kernel, xen-devel, netdev
  Cc: boris.ostrovsky, davem, Juergen Gross, stable

skb_shinfo() can change when calling __pskb_pull_tail(): Don't cache
its return value.

Cc: stable@vger.kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 drivers/net/xen-netfront.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 2d8812dd1534..9dd2ca62d84a 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -894,7 +894,6 @@ static RING_IDX xennet_fill_frags(struct netfront_queue *queue,
 				  struct sk_buff *skb,
 				  struct sk_buff_head *list)
 {
-	struct skb_shared_info *shinfo = skb_shinfo(skb);
 	RING_IDX cons = queue->rx.rsp_cons;
 	struct sk_buff *nskb;
 
@@ -903,15 +902,16 @@ static RING_IDX xennet_fill_frags(struct netfront_queue *queue,
 			RING_GET_RESPONSE(&queue->rx, ++cons);
 		skb_frag_t *nfrag = &skb_shinfo(nskb)->frags[0];
 
-		if (shinfo->nr_frags == MAX_SKB_FRAGS) {
+		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));
 			__pskb_pull_tail(skb, pull_to - skb_headlen(skb));
 		}
-		BUG_ON(shinfo->nr_frags >= MAX_SKB_FRAGS);
+		BUG_ON(skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS);
 
-		skb_add_rx_frag(skb, shinfo->nr_frags, skb_frag_page(nfrag),
+		skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
+				skb_frag_page(nfrag),
 				rx->offset, rx->status, PAGE_SIZE);
 
 		skb_shinfo(nskb)->nr_frags = 0;
-- 
2.13.7


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Xen-devel] [PATCH] xen/netfront: don't cache skb_shinfo()
  2018-08-09 14:42 [PATCH] xen/netfront: don't cache skb_shinfo() Juergen Gross
@ 2018-08-09 14:47 ` Wei Liu
  2018-08-11 16:42 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Wei Liu @ 2018-08-09 14:47 UTC (permalink / raw)
  To: Juergen Gross
  Cc: linux-kernel, xen-devel, netdev, boris.ostrovsky, davem, stable, Wei Liu

On Thu, Aug 09, 2018 at 04:42:16PM +0200, Juergen Gross wrote:
> skb_shinfo() can change when calling __pskb_pull_tail(): Don't cache
> its return value.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Wei Liu <wei.liu2@citrix.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen/netfront: don't cache skb_shinfo()
  2018-08-09 14:42 [PATCH] xen/netfront: don't cache skb_shinfo() Juergen Gross
  2018-08-09 14:47 ` [Xen-devel] " Wei Liu
@ 2018-08-11 16:42 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-08-11 16:42 UTC (permalink / raw)
  To: jgross; +Cc: linux-kernel, xen-devel, netdev, boris.ostrovsky, stable

From: Juergen Gross <jgross@suse.com>
Date: Thu,  9 Aug 2018 16:42:16 +0200

> skb_shinfo() can change when calling __pskb_pull_tail(): Don't cache
> its return value.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Juergen Gross <jgross@suse.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-11 16:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-09 14:42 [PATCH] xen/netfront: don't cache skb_shinfo() Juergen Gross
2018-08-09 14:47 ` [Xen-devel] " Wei Liu
2018-08-11 16:42 ` David Miller

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).