Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3322142pxf; Mon, 15 Mar 2021 07:07:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypedrb2AQLuSYZAuRcQ7GwYrpBjSlYdT0mTxqu3fvGLP4vT2eo3iVe6e/Nd5+GJL2VN8EO X-Received: by 2002:a05:6402:382:: with SMTP id o2mr30861929edv.238.1615817233094; Mon, 15 Mar 2021 07:07:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615817233; cv=none; d=google.com; s=arc-20160816; b=erixYMuUJGw+qOWteNm9tVbZYJhKKrodiFSKOtggtwYyM62X0kAWpsxqPPAnMyMwNG fCHjjb8W4I4Btn1ikmnLtKfRHXUxPQ+JwGti5+hZqXyFjeS1/5xt3dlSrRpOi1ckSmpj tq8VAQoteBFzZkMec6vR8J6IxAzYbVbqShGIqJ7cFl/hodj7BOviW7waIk+jkR3+bRfn a2NO5XW6ee/UuDZcMOKPD+TzbG8pwtcRBxMkWX72oo3Je7rYHsslSLBX4jzXbbWUVupu 13gPznsDDYyNFQFX2VCEc6KOF8VvG1HTTNfPLMyTXnSifjvW1obHUOhxr2z1UFTi/qtH NNUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/9g3N+FvMSDxnQZGUVHVWs7T3ctITHuivW+n/C37YHw=; b=ps3X+NUA7aScgOiM2dCYFTasB2LsyEk8aKyLNOOIw9BotzUShxb6VYFE7i1G5lv8A7 k92JLp6IgjrVkSJ3wSyxQgXJ2+1yY9eAtwgtAGDWdThV+ZFWCmKrfOSpql2zLBsihdIA HEJSYQegOYduKQ2/EmyF392epABUKPxMC0NZ2Rqa/QN03MgzbpkaBp3t/ZTOur5Kr1fQ zF+d45kNS1oQb1zJrpVscBGhe6z32H9wPK4yyc65b/M+9s+6en0SnAsfymnQkYrec8aK 5iFk8dj+LRwtRSFmmAU+hemJf28RnxC3uJQXV7poQFB2tC5jwvzKve/uG/NeVbmTZZjq s4cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VurUmoFz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j13si10893915edn.369.2021.03.15.07.06.49; Mon, 15 Mar 2021 07:07:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VurUmoFz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231730AbhCOODd (ORCPT + 99 others); Mon, 15 Mar 2021 10:03:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:34198 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231448AbhCON5K (ORCPT ); Mon, 15 Mar 2021 09:57:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DC7D664F27; Mon, 15 Mar 2021 13:57:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816630; bh=jSKspWM7EfzKqcDjD2f4ifI8H3zPgj3EYllVYCjybuA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VurUmoFzjw36QIHYSgsvdpmXpqNK+zo/o+cC9q+leWLNZXK9aRwIcKbRzyGTlUZLv PXn3FImI23jBh3yPQM7PzgSlfxvyXeuF8+OQoo+vI+wAqE6eDtWzMcyvM+U60Og9qN HT7o9AOVlojlZpsvZ+Y12LJlsSgNmTMJNiGYUMtQ= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hangbin Liu , Daniel Borkmann , William Tu Subject: [PATCH 5.11 030/306] selftests/bpf: No need to drop the packet when there is no geneve opt Date: Mon, 15 Mar 2021 14:51:33 +0100 Message-Id: <20210315135508.643502597@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Hangbin Liu commit 557c223b643a35effec9654958d8edc62fd2603a upstream. In bpf geneve tunnel test we set geneve option on tx side. On rx side we only call bpf_skb_get_tunnel_opt(). Since commit 9c2e14b48119 ("ip_tunnels: Set tunnel option flag when tunnel metadata is present") geneve_rx() will not add TUNNEL_GENEVE_OPT flag if there is no geneve option, which cause bpf_skb_get_tunnel_opt() return ENOENT and _geneve_get_tunnel() in test_tunnel_kern.c drop the packet. As it should be valid that bpf_skb_get_tunnel_opt() return error when there is not tunnel option, there is no need to drop the packet and break all geneve rx traffic. Just set opt_class to 0 in this test and keep returning TC_ACT_OK. Fixes: 933a741e3b82 ("selftests/bpf: bpf tunnel test.") Signed-off-by: Hangbin Liu Signed-off-by: Daniel Borkmann Acked-by: William Tu Link: https://lore.kernel.org/bpf/20210224081403.1425474-1-liuhangbin@gmail.com Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/bpf/progs/test_tunnel_kern.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/tools/testing/selftests/bpf/progs/test_tunnel_kern.c +++ b/tools/testing/selftests/bpf/progs/test_tunnel_kern.c @@ -446,10 +446,8 @@ int _geneve_get_tunnel(struct __sk_buff } ret = bpf_skb_get_tunnel_opt(skb, &gopt, sizeof(gopt)); - if (ret < 0) { - ERROR(ret); - return TC_ACT_SHOT; - } + if (ret < 0) + gopt.opt_class = 0; bpf_trace_printk(fmt, sizeof(fmt), key.tunnel_id, key.remote_ipv4, gopt.opt_class);