From patchwork Wed Nov 26 02:28:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 414966 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B6734140174 for ; Wed, 26 Nov 2014 13:28:46 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751916AbaKZC2a (ORCPT ); Tue, 25 Nov 2014 21:28:30 -0500 Received: from mail-ob0-f173.google.com ([209.85.214.173]:43821 "EHLO mail-ob0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751134AbaKZC23 (ORCPT ); Tue, 25 Nov 2014 21:28:29 -0500 Received: by mail-ob0-f173.google.com with SMTP id uy5so1516728obc.4 for ; Tue, 25 Nov 2014 18:28:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EesqpaOSx2MFlNeF+HYZDFvvsHOHz6z4+tqR7C16XvE=; b=MAsGg66otaTdUrjL1UckSmerbhxFZXKddnEgX7qMqRrLs37jxGGKZ1ePfrTbVgy58f NzyliUndDhuIBOLAnEmJu/s5BjqYhnR47gOZm3gaHGFajOa06BV04XkG4YRdE/jWhRDy lTzPoRV5cclXuAyI+qcTtWiYWdv5hezm4LIpRc1ECrI3jH3baARwjYKGPxYB6By0p2+i 8ky8V9EAc9jxnceVRKMJgBRe4AAcdTSEWCVaBQmyhuMEOrudPXTqi7+cIK35YzY3/8ME aWhsdXlMUYG5SJT6IOPYdfG4X0x6CfPvzE5LZ7am5De8w6TDywV3bxglRHj6hToTbzu5 OeOw== X-Gm-Message-State: ALoCoQmW6VOxtr5u09xnT5ui8Mth+CVI5Be4DQkq5271Kyty0h4OVM+sIwvm6ZeWB285ubwF3nge X-Received: by 10.202.214.80 with SMTP id n77mr17742192oig.9.1416968908832; Tue, 25 Nov 2014 18:28:28 -0800 (PST) Received: from localhost (199-87-125-144.dyn.kc.surewest.net. [199.87.125.144]) by mx.google.com with ESMTPSA id l4sm1269960oib.11.2014.11.25.18.28.28 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 25 Nov 2014 18:28:28 -0800 (PST) From: Seth Forshee To: Konrad Rzeszutek Wilk , Boris Ostrovsky , David Vrabel Cc: Zoltan Kiss , Eric Dumazet , Stefan Bader , Seth Forshee , xen-devel@lists.xenproject.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] xen-netfront: Remove BUGs on paged skb data which crosses a page boundary Date: Tue, 25 Nov 2014 20:28:24 -0600 Message-Id: <1416968904-70874-1-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 1.9.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org These BUGs can be erroneously triggered by frags which refer to tail pages within a compound page. The data in these pages may overrun the hardware page while still being contained within the compound page, but since compound_order() evaluates to 0 for tail pages the assertion fails. The code already iterates through subsequent pages correctly in this scenario, so the BUGs are unnecessary and can be removed. Fixes: f36c374782e4 ("xen/netfront: handle compound page fragments on transmit") Cc: # 3.7+ Signed-off-by: Seth Forshee Reviewed-by: David Vrabel --- drivers/net/xen-netfront.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index cca871346a0f..ece8d1804d13 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -496,9 +496,6 @@ static void xennet_make_frags(struct sk_buff *skb, struct netfront_queue *queue, len = skb_frag_size(frag); offset = frag->page_offset; - /* Data must not cross a page boundary. */ - BUG_ON(len + offset > PAGE_SIZE<> PAGE_SHIFT; offset &= ~PAGE_MASK; @@ -506,8 +503,6 @@ static void xennet_make_frags(struct sk_buff *skb, struct netfront_queue *queue, while (len > 0) { unsigned long bytes; - BUG_ON(offset >= PAGE_SIZE); - bytes = PAGE_SIZE - offset; if (bytes > len) bytes = len;