From nobody Mon Feb 9 06:49:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1652778491; cv=none; d=zohomail.com; s=zohoarc; b=hVDLyTt4X1kgk8Uasnx88AOvOkMLsfGqDT6mKy/A5ixkMGML1b2daFM2/H4DXU9QzZ/JlULgZGOJD2ITqh/Rl95K4Nj9QgawbVq6MiA36I5XaqBhsrFVFDUSaT7g9c8x4mw0nydGnGpi4xP0wsbdI/q//iqCgeubAs4gc2A1yJo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652778491; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tadNXsxXYI6gNj0BML3n2/BFZ4Ar1UoTLdsKr18lRro=; b=MMcbaN9ziXI2yh8jrrzgnEBH0xcYzQr1ZfOXmxA7CHJGecW7ai3ETvaAPmrpC7Hc8cbbouNK7YEeGkhub8tW79SIwacrOf1BZydGe0safqG7WzH4H5a3nQFTKt1z6iOpey9snv5rLmlZwl3wm6Cs1u6Wc0J053BRWm9Xo1c81Ow= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1652778491344522.6616093756534; Tue, 17 May 2022 02:08:11 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-325-6WNdXiBrOLm-zFM0qZ9RCA-1; Tue, 17 May 2022 05:07:38 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D07781C161CC; Tue, 17 May 2022 09:07:35 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD0F8156D12A; Tue, 17 May 2022 09:07:35 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 66F7E194707F; Tue, 17 May 2022 09:07:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8DFD41947056 for ; Tue, 17 May 2022 09:07:33 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 699B4156D120; Tue, 17 May 2022 09:07:33 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id E2DE1156D12B for ; Tue, 17 May 2022 09:07:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652778490; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=tadNXsxXYI6gNj0BML3n2/BFZ4Ar1UoTLdsKr18lRro=; b=KebN0otL9cCuLhPiSJD9QUWcH4auVMDORubHB6MSNLP1brBnkvmpjQ5EcHbDi6D4VXjyv9 daCv1kFrrN07cwB9NphWDPSHoCsqrhSCXjutCDcCe5RyDDMJL5hZ87tEKjO4kPcYLTrCHx ZLCgdRQ2O7nErc5nfbhTHPGmBJx8CK0= X-MC-Unique: 6WNdXiBrOLm-zFM0qZ9RCA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 6/9] qemuFDPassValidate: Don't validate file descriptors Date: Tue, 17 May 2022 11:07:23 +0200 Message-Id: <0f3a4f9e21a1359c75d9e6858883219d1fc3cedf.1652778351.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652778492406100001 Content-Type: text/plain; charset="utf-8" The callers adding the FDs are validating them regardless so this check was redundant. Signed-off-by: Peter Krempa --- src/qemu/qemu_fd.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/qemu/qemu_fd.c b/src/qemu/qemu_fd.c index 442f92df2f..fc9fecbb0e 100644 --- a/src/qemu/qemu_fd.c +++ b/src/qemu/qemu_fd.c @@ -68,8 +68,6 @@ qemuFDPassFree(qemuFDPass *fdpass) static int qemuFDPassValidate(qemuFDPass *fdpass) { - size_t i; - if (!fdpass->useFDSet && fdpass->nfds > 1) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -77,14 +75,6 @@ qemuFDPassValidate(qemuFDPass *fdpass) return -1; } - for (i =3D 0; i < fdpass->nfds; i++) { - if (fdpass->fds[i].fd < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("invalid file descriptor")); - return -1; - } - } - return 0; } --=20 2.35.3