From patchwork Mon Dec 11 21:50:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 847255 X-Patchwork-Delegate: jpettit@nicira.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kZJiBOgp"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ywcGq4lMZz9t2M for ; Tue, 12 Dec 2017 08:56:19 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 55A11DBE; Mon, 11 Dec 2017 21:51:12 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 86772D96 for ; Mon, 11 Dec 2017 21:51:10 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 4A08E524 for ; Mon, 11 Dec 2017 21:51:10 +0000 (UTC) Received: by mail-pg0-f66.google.com with SMTP id o2so11882986pgc.8 for ; Mon, 11 Dec 2017 13:51:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DxHfTi2xZrSAa8TyxaWx1y1f5neAmfGOxlw8Yddt0hY=; b=kZJiBOgpWXnalSAN2sEiT5DGkngBTU22RVagAmIj4LHHXI5462VOO/av5i9RXNHLoR cG0StR4inlhgPKVPsya7rWML/XTXTjB4y28yiJDLLUed/KrEdrMjDWdpmcm2ralp96U0 ARSC6qEZrDH6bgeaiGXVIAvaBbSznHwlHwh/dGujAs/K0vLhcMo1WpjPKbmi+XqJsAfk 4pbUW5469mr5q/6iEqZ61IRgOV5KpyIDPAWlggCLOoQYOuzTXrV27sc6pBQcDZIGdkR7 NBeLxZJCMpK9l4R4VVjrQFyo5V6YXGyKuUnJBcUYL4hbCO7Cmvy7nsSLFzCRP64okaFS QyJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DxHfTi2xZrSAa8TyxaWx1y1f5neAmfGOxlw8Yddt0hY=; b=ffIvbYV3z+1dusRt3xpik9Ak1zxtNHxHD+WylrS8MjWwULgDhPeXij3WZib9Me5DVM 7L5TW0ye/IqCK+9K78cFHBVIcE9FIU+uiFNjkixyzaFZNGcfGy80Ar8mUBqH/Ot/So00 kt6+b/YsThNTp6f7UU6kbjApjpYdQJN2VUcSXUfktb/jDv4pzXNS0gD+O2+9bT54PvmV J2u4p3iDYqWq9Zax2t3U8HcMxrBhgqXRbqt2Dw8SGNBuQ2U4xplBzPj5j2Z85+KZh/px GzMOhoO31omR7PNj/OWFwRGmnX+0svBpOaWkrUCHZxzLrz/1BtkKAGmeY7mUf79gMnXS AHHw== X-Gm-Message-State: AKGB3mKkrwTIony+31HSE1fwrvTc+NN93x7EShuLzoqbMnH67mueE1PV VW0L5GEgG7Cb5CUvFHMuaWkYPCUi X-Google-Smtp-Source: ACJfBovs5OK10mLfEjPnEP4tz7Ve6h8zFKKAf4CnDTG1zuvqCubaBXX4DPIGxpDDxGfoGhjpR5rWrQ== X-Received: by 10.101.93.66 with SMTP id e2mr4872pgt.50.1513029069519; Mon, 11 Dec 2017 13:51:09 -0800 (PST) Received: from gizo.domain (67-5-143-47.ptld.qwest.net. [67.5.143.47]) by smtp.gmail.com with ESMTPSA id c185sm25572799pfb.48.2017.12.11.13.51.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 13:51:08 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Mon, 11 Dec 2017 13:50:30 -0800 Message-Id: <1513029033-9087-10-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1513029033-9087-1-git-send-email-gvrose8192@gmail.com> References: <1513029033-9087-1-git-send-email-gvrose8192@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: "Gustavo A. R. Silva" Subject: [ovs-dev] [PATCH 09/12] datapath: fix data type in queue_gso_packets X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: "Gustavo A. R. Silva" Upstream commit: commit 2734166e89639c973c6e125ac8bcfc2d9db72b70 Author: Gustavo A. R. Silva Date: Sat Nov 25 13:14:40 2017 -0600 net: openvswitch: datapath: fix data type in queue_gso_packets gso_type is being used in binary AND operations together with SKB_GSO_UDP. The issue is that variable gso_type is of type unsigned short and SKB_GSO_UDP expands to more than 16 bits: SKB_GSO_UDP = 1 << 16 this makes any binary AND operation between gso_type and SKB_GSO_UDP to be always zero, hence making some code unreachable and likely causing undesired behavior. Fix this by changing the data type of variable gso_type to unsigned int. Addresses-Coverity-ID: 1462223 Fixes: 0c19f846d582 ("net: accept UFO datagrams from tuntap and packet") Signed-off-by: Gustavo A. R. Silva Acked-by: Willem de Bruijn Signed-off-by: David S. Miller Cc: Gustavo A. R. Silva Signed-off-by: Greg Rose --- datapath/datapath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index eff9f85..9baa52e 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -312,7 +312,7 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb, const struct dp_upcall_info *upcall_info, uint32_t cutlen) { - unsigned short gso_type = skb_shinfo(skb)->gso_type; + unsigned int gso_type = skb_shinfo(skb)->gso_type; struct sw_flow_key later_key; struct sk_buff *segs, *nskb; struct ovs_skb_cb ovs_cb;