Received: by 10.192.165.156 with SMTP id m28csp268412imm; Tue, 17 Apr 2018 09:50:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx486I+Joe0VIbzrIfzF8ihj6XVyyTamUYb/o864xblBB88/M6xDoS/5Ra97zZx5FuCz2pK+K X-Received: by 2002:a17:902:778e:: with SMTP id o14-v6mr2699702pll.294.1523983829971; Tue, 17 Apr 2018 09:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523983829; cv=none; d=google.com; s=arc-20160816; b=mI3dgsZocN2tOe2I8suxT/otEwsAa6DoR/sycbmRJTgeoDs/tOKYUys9+M1iaQBJM9 QyTtT2+8pHD9+WTYOZVNs/O9QcSIatU/zauPIf1zDHYmvByKkimPWMQj5xab815gnDSI CIV+CAw9sNcUCG/MekQSbXZ9KkJLxXREozszDw8MSDO+kSz2LkPoPBV7F+zZw6/BdCFv gVHT3DFOIgnjeFD5MJPB7yiHVOhsdiM4Z+jkQ3HVwmi1Q9VfJlZtSh2hD1XgqF4MYd+q CjzdzduqXmkHNMGaPRR3BTf9rtFwDfvs4UXwoa6YflNVQoNdPMW92lca8e6LnyRZkCnx HIgA== 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=6Hrc4CfXEoCf7tF/wV7eVQ687HXlXwWfKro1CycxtSo=; b=ENkFzlnwA50WoGOXLiBNpWyuEs+h88r3NEznVUUmTF3H0TaTWAP5sB8D7LHi1FJnzt bKCxxBk0wHtOUnV2Nm1KIt7osOhoLbiXnHg0RlzQtoM59BIYoqCfftn44Ro4ktaxUXBa 4fLWNgchuw7/Le0plPsQ8jUVqL2vYf6pqX2hHYLXlJsZ8Dqd7rY7PG81roNXMVEIP2dT Fw7Wows4aZiIYT/Q10zGAkSZMyZb8mpt72gg2v+/JZdXQY/mR4HKdvsip+T45E446YwO 0b7+aEo4/VVZRBJuaqjPXp/8JPHyVmvErZIjzkDopWTTZv8l2krG+mlHF+vfq4latSqq kJAw== 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 j21si13220311pfe.132.2018.04.17.09.50.15; Tue, 17 Apr 2018 09:50:29 -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 S1754634AbeDQQEx (ORCPT + 99 others); Tue, 17 Apr 2018 12:04:53 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34370 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754614AbeDQQEv (ORCPT ); Tue, 17 Apr 2018 12:04:51 -0400 Received: from localhost (unknown [46.44.180.42]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 890818E3; Tue, 17 Apr 2018 16:04:50 +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.15 09/53] ip_gre: clear feature flags when incompatible o_flags are set Date: Tue, 17 Apr 2018 17:58:34 +0200 Message-Id: <20180417155723.471375692@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180417155723.091120060@linuxfoundation.org> References: <20180417155723.091120060@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.15-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 @@ -796,8 +796,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); } }