Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp875027imu; Fri, 11 Jan 2019 10:33:52 -0800 (PST) X-Google-Smtp-Source: ALg8bN4rVl3W5lE2/UpYozeF7ZXr/xBlTFyHzdtwQp2Phucvqt4HPZq3MlpnNpEWdBrF963tI+gZ X-Received: by 2002:a17:902:7044:: with SMTP id h4mr15522469plt.35.1547231632586; Fri, 11 Jan 2019 10:33:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547231632; cv=none; d=google.com; s=arc-20160816; b=UGYVpG045a6ZsxSQmkTAGAansK74bOXDCXBW5cgi/6x28QDx+W3ayKQu/+aTfN6dfG Yc+tKTiBiBT+rrGsyBKv/NvO2udHXXqlRYxYI/AuLJRQCyDS4Apgq7wEjnRTTvkzr03X l3/kud1B95+tU13aoOArrmNspDrtZ9a4ayJbmqP3UfaE1XZYc3tw/G+m0UeqBpnziEP/ ET4aC1ucj/Ak6GlNHY8klkXA3EnhKsOsLSRxC9O4XCrwVvfcLhxnq7H7OJ5m3ShMjiWR ch6XUDv1rNvUQjhbSo0xLbfphygoFyuMOls3xA2HJJ2GpqPEkJA8NGqMGGMSB9K2ej9b E3PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bOZ1z0BC+eTxwcIhQu0szEAsgO/PA1QFlnU7ZurNij8=; b=OYefA68A+9g3BF4uJaZrOzLRZbrFjGS2/NgvPQDZsO2YNUpFHFtes/jAaXVcAeo6wp C/NDXguODXRrAoWxHbjQEYCPeMD1JZVfcWqiUSicHm/sk/f3VKcqz5Q1T0F2ipig2dI2 dkdzm6lvrTSBI1sdCzAJJ+nYoWm/UJQAg3sn+ItKwFHUpHnaGRNkhwpLM80Knq87kfhz HV57LF95PZPX/HmpJLF7izN/3pfQt9NEF5TnolypxAXQzjnaZnUL13VwYgxslpwMOD55 jkUhpP6ZKhMwYKSwtU2OrHWfVkaELZp+nruVvDIvSbEiu55QfCX6n+OO8jaIykjRyobq 11Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Vcx7ZY6S; 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 g31si59312823pld.358.2019.01.11.10.33.37; Fri, 11 Jan 2019 10:33:52 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Vcx7ZY6S; 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 S1731763AbfAKOR1 (ORCPT + 99 others); Fri, 11 Jan 2019 09:17:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:33806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729564AbfAKORY (ORCPT ); Fri, 11 Jan 2019 09:17:24 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F075D2177B; Fri, 11 Jan 2019 14:17:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547216243; bh=6H3ujWPjbVHbrG2+00y2M2QkEO+p86mu9x1SfKhpCqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vcx7ZY6Sn9tIP8ZZROnuCzYyKGKkqdYeXdLRmKX1iZmsaYavD0jKEIzDLGxk71NIc Mw6+l/pinLKEGxhfSSAAq1GgSbRBvxXOFKhoqPlJgvjUIWx7OGgr3yBG6NaWA5/kU6 CBfhagskgscxbjpg+Q7uaRZ/viPTX8IeSlRg2W7Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dietmar Hahn , Juergen Gross , "David S. Miller" Subject: [PATCH 4.4 27/88] xen/netfront: tolerate frags with no data Date: Fri, 11 Jan 2019 15:07:56 +0100 Message-Id: <20190111131050.132215217@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111131045.137499039@linuxfoundation.org> References: <20190111131045.137499039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Juergen Gross [ Upstream commit d81c5054a5d1d4999c7cdead7636b6cd4af83d36 ] 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 Signed-off-by: Juergen Gross Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/xen-netfront.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -889,7 +889,7 @@ static RING_IDX xennet_fill_frags(struct 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)) {