Received: by 10.192.165.156 with SMTP id m28csp289652imm; Tue, 17 Apr 2018 10:09:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+ECi720em93WCmNQ2hyoDL7o6GDR/Z2Ubddc5pk/rlSvcXZTYx9AfMK517KEGL93Dn2pv2 X-Received: by 10.99.61.202 with SMTP id k193mr2395978pga.435.1523984955234; Tue, 17 Apr 2018 10:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523984955; cv=none; d=google.com; s=arc-20160816; b=wvmhIUSqJR8sHhxztLQ+aToFfrPKeSEaO3ht6oGDIoGGe1h+BJ0hVXsR1ZhC0VWzjl Ea/8fyDsNnxxUfM5HQr1e8eFwx/1q1fvQA9PQm484/S2h9unzFa5w8dKbLCNZ7smWPk+ 26rStrebdh/Da1Qx6RpYUzuxLu4PyCz0wjGkO9hOR9oxpb8lKc5W9wrRRre602MO7E75 e1a+kH2ZEF1wfVVDhJOVuLtA/mYrXuhG7oNqiaDx3mlGj7npvcyarf6yTFoia8QnjFDS FZqQEYBqdmS6rXQyLvBMiFqLZ8UanS9pSbMnxesNXopbxlqgFkUlkeSyYYhTdB1g3w5N w5Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=K6wifGSUsCzPuxuwjB6vZYsnjY8DC2nL31L8ILA7lIA=; b=PxyaHwzH4FbuPFZxCUM88RAasX0NKZwZ3y7TNFBDNmR2T/vOAKx+2an0vzy7Fwim8m uHXATa/A++cjCj5bHG+62rCEAU97HCVlud30EDqk2c6cKKciP9vsv4C0LzQMu3puqtvw PPVp3BILMn77QbpQh4FBn22U4yJW/Kx6qTBury7p+bY1f3ow0/nzRWezSraz4qYN+AIE jUGx6PTC7b8Sw2+u5CIp6r3PK+B48xkEGgfNgsZZW6H1INnRE3uVjv1j1i49/a/VZqTK eoXe6YGD4wrgPqZw7DW1C+q9gmGV42m/aW31Xx6vYP4E5c+R/Hj+ffjZSQt2xQ4nsRvf Mf/w== 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 u4si11793248pgp.564.2018.04.17.10.08.59; Tue, 17 Apr 2018 10:09:15 -0700 (PDT) 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 S1753399AbeDQQA7 (ORCPT + 99 others); Tue, 17 Apr 2018 12:00:59 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60256 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751836AbeDQQAx (ORCPT ); Tue, 17 Apr 2018 12:00:53 -0400 Received: from localhost (unknown [46.44.180.42]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 29346D59; Tue, 17 Apr 2018 16:00:53 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sabrina Dubroca , Xin Long , William Tu , "David S. Miller" Subject: [PATCH 4.16 07/68] ip_gre: clear feature flags when incompatible o_flags are set Date: Tue, 17 Apr 2018 17:57:20 +0200 Message-Id: <20180417155749.638564160@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180417155749.341779147@linuxfoundation.org> References: <20180417155749.341779147@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sabrina Dubroca [ Upstream commit 1cc5954f44150bb70cac07c3cc5df7cf0dfb61ec ] Commit dd9d598c6657 ("ip_gre: add the support for i/o_flags update via netlink") added the ability to change o_flags, but missed that the GSO/LLTX features are disabled by default, and only enabled some gre features are unused. Thus we also need to disable the GSO/LLTX features on the device when the TUNNEL_SEQ or TUNNEL_CSUM flags are set. These two examples should result in the same features being set: ip link add gre_none type gre local 192.168.0.10 remote 192.168.0.20 ttl 255 key 0 ip link set gre_none type gre seq ip link add gre_seq type gre local 192.168.0.10 remote 192.168.0.20 ttl 255 key 1 seq Fixes: dd9d598c6657 ("ip_gre: add the support for i/o_flags update via netlink") Signed-off-by: Sabrina Dubroca Reviewed-by: Xin Long Acked-by: William Tu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/ip_gre.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -778,8 +778,14 @@ static void ipgre_link_update(struct net tunnel->encap.type == TUNNEL_ENCAP_NONE) { dev->features |= NETIF_F_GSO_SOFTWARE; dev->hw_features |= NETIF_F_GSO_SOFTWARE; + } else { + dev->features &= ~NETIF_F_GSO_SOFTWARE; + dev->hw_features &= ~NETIF_F_GSO_SOFTWARE; } dev->features |= NETIF_F_LLTX; + } else { + dev->hw_features &= ~NETIF_F_GSO_SOFTWARE; + dev->features &= ~(NETIF_F_LLTX | NETIF_F_GSO_SOFTWARE); } }