From patchwork Sat Oct 22 07:21:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7460 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1098783wrr; Sat, 22 Oct 2022 01:11:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6nS1fKFhHYyMJc+JLBEZvjwUymLzif3mi2qOzxXo7jw88BhWSNKlXt++yd+6zMcifj6uKB X-Received: by 2002:a17:90b:3555:b0:20a:c2d5:d361 with SMTP id lt21-20020a17090b355500b0020ac2d5d361mr27224425pjb.50.1666426294607; Sat, 22 Oct 2022 01:11:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666426294; cv=none; d=google.com; s=arc-20160816; b=tmgnHZRwQJdf041c2TmrlGmaa63YucXIAL1cPJvlKvWejE36QmHYrufYEIzklmXbGJ 8zIBCzGVAVSsHUTSymZhtTckmVPoBBImt9uuyxVpPiYw7pBdMdBQhIyol4qaKDdtoIzG tcdAUl/m03pVLqg+A4j/RUEPISskO4H3uUbacBYNBQgPr7+E+LovOsJs/U4aJg8iMh4F gb5Hy32AZwA38odg9p8kvdKiIAQ96PagFPwcAENLTQ6S8XAJFh3r2udHcl5nzFr4SxW2 ISmrZ6V70lMfu5NMQko+EvlRbkx1O7VYQFtPOLfrwuKaBXypCeGpbi8Ic7o08J7eqQc0 iHsQ== 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=1+ZvcSNhTKhHUKzDSrSWZl+WehQmPbqRCMB+hhQPc64=; b=wo/P2/ly7ZHod2d8KWvBmNWWw/Rw12nva/GKQWuq2Fvtj5tcK3uoUpPuqATMd3xAwM 28ui5QijCk+DitpN+x2ec+4u0dISnCg86DEelxw/n6XGOT9ZD9yV6fTLLsoKf5IcPxwJ uZuBw7NTmwQXWsfDhpZ/jZF5t94F0808+2jLabpd+0Iu9d6m7jTPtxE82fXIfoqoYuE9 h4kCvtgwtIB+FggvQuS8QhX3QJSrOiCAo2pXZdB6GTeiCyBMx7Xnt6stylQFUPgQEBdM u8P6vVnJy3fDDkkmv+VdQKyH+v+UdHWO85GbjRIOj1O1JE+TgLL+7MEQZbfIckMJLk8l jbOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DaLmg7+u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c15-20020a056a00248f00b00543bc7e5bc9si27676398pfv.361.2022.10.22.01.11.22; Sat, 22 Oct 2022 01:11:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DaLmg7+u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233085AbiJVIKe (ORCPT + 99 others); Sat, 22 Oct 2022 04:10:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232818AbiJVIGQ (ORCPT ); Sat, 22 Oct 2022 04:06:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45B242D6549; Sat, 22 Oct 2022 00:53:06 -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 D4F2960BA5; Sat, 22 Oct 2022 07:43:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9E96C433C1; Sat, 22 Oct 2022 07:43:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424630; bh=sMlQcK6UppnZaZaiO1W30seCru7s+7kjiXGTuxdCF+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DaLmg7+u6qsqwqH++qf9UZcqWW9WLC4hALelF+0BNvZ14sxZf3Y6Bw6qYVMMFqXlS kDlRxEACDhq1nYw8+MJG585xVSzhanKUMo5uSNCtBEWVjMYT0DEYeWFHBWhYfQ5XR/ SQNQ1fwARx0MRCFUY4JkDwkkcrndaTdU7HjT5JnY= 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 5.19 217/717] selftests/xsk: Add missing close() on netns fd Date: Sat, 22 Oct 2022 09:21:36 +0200 Message-Id: <20221022072453.646112428@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747374617989341077?= X-GMAIL-MSGID: =?utf-8?q?1747374617989341077?= 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/xdpxceiver.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/bpf/xdpxceiver.c b/tools/testing/selftests/bpf/xdpxceiver.c index e5992a6b5e09..92e466310e27 100644 --- a/tools/testing/selftests/bpf/xdpxceiver.c +++ b/tools/testing/selftests/bpf/xdpxceiver.c @@ -1589,6 +1589,8 @@ static struct ifobject *ifobject_create(void) if (!ifobj->umem) goto out_umem; + ifobj->ns_fd = -1; + return ifobj; out_umem: @@ -1600,6 +1602,8 @@ static struct ifobject *ifobject_create(void) static void ifobject_delete(struct ifobject *ifobj) { + if (ifobj->ns_fd != -1) + close(ifobj->ns_fd); free(ifobj->umem); free(ifobj->xsk_arr); free(ifobj);