From patchwork Fri Jun 19 14:32:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 224057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2D39C433DF for ; Fri, 19 Jun 2020 15:28:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C997421924 for ; Fri, 19 Jun 2020 15:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592580527; bh=iGDstssJZNRPmYGflzsJwE0HzniypEW0XvpWSC3yA2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=TPLO7CElOIiaIVc8mxgmKEz5oFgkbXlLd/Cf6ddFWBZoJmU6Lo8ukLS6XUrgdZtH/ OYH60KZaN7WimBpaZdoZ52LSpg/Yg4WnziAcSCU+01M4h9TZBqr9RBDcsoYXA6p83X K28q9eXk/i9SQJzDtKkelHgrkvVUOMdm6+qlLcXE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393648AbgFSP2n (ORCPT ); Fri, 19 Jun 2020 11:28:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:60494 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393644AbgFSP2m (ORCPT ); Fri, 19 Jun 2020 11:28:42 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 173A321924; Fri, 19 Jun 2020 15:28:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592580521; bh=iGDstssJZNRPmYGflzsJwE0HzniypEW0XvpWSC3yA2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y7vqGFllGuVq4PXDXrz/ZqKpS/Ve09ULDyVsrfmWfJy2+DbTcmBwxevwACvV1EtsR GPY++qmCvCukDf/ORSyrKvrC/r/+cbvE3CZhfSTQuxI00TutZng5y6Qa0bEhEQpDRf HZGdd6hNa81C+Y0tRaWbwU6hxhakvE5fxanGsUMA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jakub Sitnicki , Alexei Starovoitov , Sasha Levin Subject: [PATCH 5.7 251/376] selftests/bpf, flow_dissector: Close TAP device FD after the test Date: Fri, 19 Jun 2020 16:32:49 +0200 Message-Id: <20200619141722.206454468@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141710.350494719@linuxfoundation.org> References: <20200619141710.350494719@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jakub Sitnicki [ Upstream commit b8215dce7dfd817ca38807f55165bf502146cd68 ] test_flow_dissector leaves a TAP device after it's finished, potentially interfering with other tests that will run after it. Fix it by closing the TAP descriptor on cleanup. Fixes: 0905beec9f52 ("selftests/bpf: run flow dissector tests in skb-less mode") Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200531082846.2117903-11-jakub@cloudflare.com Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/prog_tests/flow_dissector.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/bpf/prog_tests/flow_dissector.c b/tools/testing/selftests/bpf/prog_tests/flow_dissector.c index 92563898867c..9f3634c9971d 100644 --- a/tools/testing/selftests/bpf/prog_tests/flow_dissector.c +++ b/tools/testing/selftests/bpf/prog_tests/flow_dissector.c @@ -523,6 +523,7 @@ void test_flow_dissector(void) CHECK_ATTR(err, tests[i].name, "bpf_map_delete_elem %d\n", err); } + close(tap_fd); bpf_prog_detach(prog_fd, BPF_FLOW_DISSECTOR); bpf_object__close(obj); }