From nobody Sat Feb 7 20:37:27 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07EB2C4332F for ; Wed, 19 Oct 2022 08:53:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231871AbiJSIxw (ORCPT ); Wed, 19 Oct 2022 04:53:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231840AbiJSIxI (ORCPT ); Wed, 19 Oct 2022 04:53:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AC8084E6D; Wed, 19 Oct 2022 01:50:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3D19461847; Wed, 19 Oct 2022 08:49:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BFC1C433D6; Wed, 19 Oct 2022 08:49:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169373; bh=EQlopx31BUyrGQu0oSTme+DKanTOBlcrCtNgTG0TuYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=spyKqjnAMoV7cSajhGgG0miGWeh5vw0bNnC/ztKfEV8jheLQOplUpaLdy+7xV574A 4+MseAQeZhGVAoOYNC2oL1MRr7hAlEyPlYL+f/aNd+2a0cZdz4/O3h+qTqvRQEIrgT KJN8BDhCjGjteGN1Ge6d8zmMf9Jo16z5teTbv5qs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maciej Fijalkowski , Daniel Borkmann , Magnus Karlsson , Sasha Levin Subject: [PATCH 6.0 252/862] selftests/xsk: Add missing close() on netns fd Date: Wed, 19 Oct 2022 10:25:39 +0200 Message-Id: <20221019083301.174955152@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Maciej Fijalkowski [ Upstream commit 8a7d61bdc2fac2c460a2f32a062f5c6dbd21a764 ] Commit 1034b03e54ac ("selftests: xsk: Simplify cleanup of ifobjects") removed close on netns fd, which is not correct, so let us restore it. Fixes: 1034b03e54ac ("selftests: xsk: Simplify cleanup of ifobjects") Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20220830133905.9945-1-maciej.fijalkowski@= intel.com Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/xskxceiver.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selft= ests/bpf/xskxceiver.c index 74d56d971baf..091402dc5390 100644 --- a/tools/testing/selftests/bpf/xskxceiver.c +++ b/tools/testing/selftests/bpf/xskxceiver.c @@ -1606,6 +1606,8 @@ static struct ifobject *ifobject_create(void) if (!ifobj->umem) goto out_umem; =20 + ifobj->ns_fd =3D -1; + return ifobj; =20 out_umem: @@ -1617,6 +1619,8 @@ static struct ifobject *ifobject_create(void) =20 static void ifobject_delete(struct ifobject *ifobj) { + if (ifobj->ns_fd !=3D -1) + close(ifobj->ns_fd); free(ifobj->umem); free(ifobj->xsk_arr); free(ifobj); --=20 2.35.1