From nobody Thu Mar 28 23:54:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578921646; cv=none; d=zohomail.com; s=zohoarc; b=ZZR6KQE3iEhFW/R9T7Hr+LuYdqozdIS0+P4mob3UawRwZvFHz3CXdzhxphnCZ4rQDBGqS6836Q0pNprZVbjrcE55V/zsyHJzFUOBa3LZLw0dlQ94dthq1eugwI3f81Mhs3ZOjL+3WJJS+3cLNpkz2FLp6silC5dUQmfTSmAgdoU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578921646; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=Gz5Lz4aYjuqOMro3tu71GhQZPaopLxxfHO04OvxZvjY=; b=HyP534iPqvucdZdqv8VChXRARnpMVl4mJRrg6ofb8SaieZp/VWOZgxCoQa4md190H0TTJ+IfLsiMXS0Vkz3b2BB26q2y/ZgL+aP8wBrvGuRdfqejzSxL0X0oku8Z3Zoujq5s3hU5c0s1AZIT5Dm2FUPdr05sTflg3EXkANwlZ5E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1578921646352670.2128793662026; Mon, 13 Jan 2020 05:20:46 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-61-ixNohBCsONC5fN_2tIDj0w-1; Mon, 13 Jan 2020 08:20:42 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 25ACF1005514; Mon, 13 Jan 2020 13:20:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5CCEE1BC6D; Mon, 13 Jan 2020 13:20:33 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6CDB11832DEE; Mon, 13 Jan 2020 13:20:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00DDKUEY013809 for ; Mon, 13 Jan 2020 08:20:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id 56C8181E31; Mon, 13 Jan 2020 13:20:30 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.43.2.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id D23C6843D4 for ; Mon, 13 Jan 2020 13:20:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578921644; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Gz5Lz4aYjuqOMro3tu71GhQZPaopLxxfHO04OvxZvjY=; b=gNisRTotZZ2buvtMpPe9c5pUeDrZco+MZd1atnmYDxV3q/7PrAb4onQvaFyAL7NA0uu+Xd LwmnLJNF+CLdsbDVHwZi22JWc+6vgbPqg0M/otGDaQLF0hqhSSEHpRPubmwFGq9v+8qwNw 5qv5Pn5RDr7aUTjC4uNX3jfJLa/qiic= From: Pavel Hrdina To: libvir-list@redhat.com Date: Mon, 13 Jan 2020 14:20:26 +0100 Message-Id: <67522a0c8332af46ce3a4c118104d5dbad13fad6.1578921604.git.phrdina@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH for 6.0.0] vircgroupv2devices: free BPF map when replacing with new one X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: ixNohBCsONC5fN_2tIDj0w-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This leaks the FD of BPF map which means it will not be freed. Signed-off-by: Pavel Hrdina Reviewed-by: Jiri Denemark --- src/util/vircgroupv2devices.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util/vircgroupv2devices.c b/src/util/vircgroupv2devices.c index 402ce3f86f..445f9c53fc 100644 --- a/src/util/vircgroupv2devices.c +++ b/src/util/vircgroupv2devices.c @@ -311,6 +311,11 @@ virCgroupV2DevicesAttachProg(virCgroupPtr group, VIR_FORCE_CLOSE(group->unified.devices.progfd); } =20 + if (group->unified.devices.mapfd > 0) { + VIR_DEBUG("Closing existing map that was replaced by new one."); + VIR_FORCE_CLOSE(group->unified.devices.mapfd); + } + group->unified.devices.progfd =3D progfd; group->unified.devices.mapfd =3D mapfd; group->unified.devices.max =3D max; --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list