Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3333213imu; Sun, 11 Nov 2018 12:35:03 -0800 (PST) X-Google-Smtp-Source: AJdET5cXnOV0AKLRbfLr/crf6zRlTOUJfN07EwL5t9vejUxxllrh6tZTlH2r5YzzbxcLkHqAFB26 X-Received: by 2002:a17:902:509:: with SMTP id 9-v6mr17143557plf.3.1541968503923; Sun, 11 Nov 2018 12:35:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968503; cv=none; d=google.com; s=arc-20160816; b=odOkCbdz7XeOwmpmzyoWy7VilFG67jY3iGffINT5M7sw1O11wxzaVlZjZOuxUuSzRN LDHCnA1y4kQWxbmLw6jlrZIyMYW3w0tQpsz7s4Qi/ODOsZFTXS1wkYY7b8k6uhQWHHID KZ8hycJBiWSZEb8ys5lJeMVFSwOmyJLxPC5FrITi4OiQcQ+wQok47qGj5mflR/wil4JK sehb2gs2z7YI8A30qTVqJFQOxuaFCFBKP83VtnKvYwl6iyUzHChF3EyKW/fNFH35P8qx SxDYqs7wBVGKFe9BwEBfifZw3KugLCIkdddLyh6riqqV77TtpBA4GwU/0xUIVmsoS29R 2rtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=bnMc/mCR4VBQl/oFGyPCI4QOmESjdyFIE6gjx9RE12g=; b=MWqWhKkLIgewX6n6jUXHu2DNw+Rh1K3eSkFM38igdTf+T4XbqXrIEStkLR2i4BCIFC HDYzkt3UrVoLNxOC2l2JLzHGNIGJcrFNqBIrEL4jZ3wS8V0dqV2wAr23rVDHcn2vlStM s36/MOY6+MijQnraDtGpXXKOhwnD654SDVhCKGTv63gCHMdBu062ngUJbhYjpjGKRplu E8f8ecSoMxd7z6oW3DeAxWzMPXaPHcD/SqMU0otBbta601MwMeaVozNz/zOuVICjg6tP /PhOy+kUfqNgN4qCh/ud1gmbWRhaPAV2r2ed2PDnBNbgfEGcKODtx0/3daL8XgqtfQjg Ig6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w20-v6si14747312plp.260.2018.11.11.12.34.48; Sun, 11 Nov 2018 12:35:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730583AbeKLGWo (ORCPT + 99 others); Mon, 12 Nov 2018 01:22:44 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:50154 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730175AbeKLFsQ (ORCPT ); Mon, 12 Nov 2018 00:48:16 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsc-0000lF-1K; Sun, 11 Nov 2018 19:58:46 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsZ-0001pv-Fc; Sun, 11 Nov 2018 19:58:43 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "David S. Miller" , "Wei Liu" , "Juergen Gross" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 321/366] xen/netfront: don't cache skb_shinfo() In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Juergen Gross commit d472b3a6cf63cd31cae1ed61930f07e6cd6671b5 upstream. skb_shinfo() can change when calling __pskb_pull_tail(): Don't cache its return value. Signed-off-by: Juergen Gross Reviewed-by: Wei Liu Signed-off-by: David S. Miller Signed-off-by: Ben Hutchings --- drivers/net/xen-netfront.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -898,7 +898,6 @@ static RING_IDX xennet_fill_frags(struct 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; @@ -907,15 +906,16 @@ static RING_IDX xennet_fill_frags(struct 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;