From nobody Sun Feb 8 19:35:28 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=1672675180; cv=none; d=zohomail.com; s=zohoarc; b=G9qzmzcLc9jDAAyICEZ9nHdaQp5P+USVMwTpf6oHgzdZUi79PEhyEfBG/bwWxFatz5Y1dF/zr+Ompan56nu15kvg89HLO17Y0edi1LT8wVFtXrADl8iuZWsYwLXsTfZBarVqGj3FSaGbtXC3H8SeGllc7CokLY9S6VsZbTbvwg8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672675180; 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=10KQT9ExGUZKlGS6wGhKjTkV+PYt08I1av/vChYFAD8=; b=QGOWM/n6J7hX18Z7UEre4DZDkrEn9gjt+q6hKmL2GkY37JSRvLXxDkDaImCAyIhOgnK/ehE87DwJMsHhWRdtvH8cSUVxMt6dUA++kGiTWEO2Ysk9HIRnDyPtwnCh/HOTcfsnQJH4I2usEC0QDYaNOS2gBZ07/By4cRiK4T8dlco= 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 1672675180951774.6615928857049; Mon, 2 Jan 2023 07:59:40 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-653-_dIrX2AvOuG3Cxh52ZhUug-1; Mon, 02 Jan 2023 10:59:38 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8CC0A86C16F; Mon, 2 Jan 2023 15:59: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 7562F39D7C; Mon, 2 Jan 2023 15:59: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 4076119465B7; Mon, 2 Jan 2023 15:59:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C58311946587 for ; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B6E93492B08; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ADF7D492B07 for ; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 93C112A59571 for ; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-324-t5t956hkMSyPjDiAH_h9bg-1; Mon, 02 Jan 2023 10:59:33 -0500 Received: by mail-ed1-f69.google.com with SMTP id h18-20020a05640250d200b004758e655ebeso18181234edb.11 for ; Mon, 02 Jan 2023 07:59:33 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id h13-20020a0564020e0d00b0046b00a9eeb5sm12745674edh.49.2023.01.02.07.59.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jan 2023 07:59:31 -0800 (PST) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 26815C5DF283 for ; Mon, 2 Jan 2023 16:59:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672675179; 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=10KQT9ExGUZKlGS6wGhKjTkV+PYt08I1av/vChYFAD8=; b=IvcIEK2lJzDUVW2ggHFinmTo1SOBXFP+XwEcdoN1EuWjlE4GPp16T/0Xhp7hGlg0RgcHON P+m2uNiCwk5AduMhrk6kGsbucGcfuELxarJL8YBnH5+56S8KibU0LdS6cjBsoM3yKn/NGM XZA+iK4TJldiFBdaDaTdcPi4i/aiwuo= X-MC-Unique: _dIrX2AvOuG3Cxh52ZhUug-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: t5t956hkMSyPjDiAH_h9bg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=10KQT9ExGUZKlGS6wGhKjTkV+PYt08I1av/vChYFAD8=; b=6/jO08cV9bnvJMYPoOdaA63O1txz36OecjcJrfKiUjIJ2xuxjsKYhiXU0tvOnLzhtR HZMJq6pbnzwuusSY4DdLX7MJ3Z1npdRosOOqHsYnGP+OxnEDez2h5MbQkaNe4+MHSIfH 3M+1N4tobNa2o0Gew6y1iUUOxjbrlRqRq25a1JNPB8hxMywwPgtluhKsBRkAIyw69BqD f/q2SNYh98xd/491JNbhorFX16bnaJS5tDzQqjIo/ItvW5Y0DM/0XdNk0SSOq7/6O75W HAveeUIUIX1SwCwvo4wxCwtkp5hpRc0K5SqBH26jCeOpzgoYwCwlUL48ykH7JRjjgyD+ TtdQ== X-Gm-Message-State: AFqh2kp/eSRucmKe2/k0IIubIVorCruAReiLqdL+aFNA/0xiV9F81vMM 8vE24MrrQdDKvLgzW1BVqjsxbSHdpiUpP36rV6REpGvSo+d8qmimlH9zi8LhGgvvyorEg0PN/hn AuYgiiltFAL6Hhv3TQUU09bySardqt27a9taKQ342on0N+6uRNpquXI4R/57IkL7+PGk2YSs= X-Received: by 2002:a17:907:cbc9:b0:7ad:b6d8:c9d0 with SMTP id vk9-20020a170907cbc900b007adb6d8c9d0mr36774408ejc.53.1672675172490; Mon, 02 Jan 2023 07:59:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXtndhanJGMJ2ReRTXpc4quDCnez1M5IIymihrRgrId2mYA91vX3tgBFNRtbDZD73VFqN3iPmw== X-Received: by 2002:a17:907:cbc9:b0:7ad:b6d8:c9d0 with SMTP id vk9-20020a170907cbc900b007adb6d8c9d0mr36774399ejc.53.1672675172259; Mon, 02 Jan 2023 07:59:32 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH 4/4] rpc: Check client limits in more places Date: Mon, 2 Jan 2023 16:59:24 +0100 Message-Id: <6e97520d0c0323624faa9e859d7defc3aab1af2a.1672675104.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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 3.1 on 10.11.54.5 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: 1672675181391100002 Content-Type: text/plain; charset="utf-8"; x-default="true" Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2033879 Signed-off-by: Martin Kletzander --- src/rpc/virnetserver.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index 2ec4b9a6c947..bf0fda04ee89 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -370,6 +370,13 @@ virNetServerNew(const char *name, g_autoptr(virNetServer) srv =3D NULL; g_autofree char *jobName =3D g_strdup_printf("rpc-%s", name); =20 + if (max_clients < max_anonymous_clients) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("The overall maximum number of clients must not b= e less " + "than the number of clients waiting for authentic= ation")); + return NULL; + } + if (virNetServerInitialize() < 0) return NULL; =20 @@ -449,6 +456,12 @@ virNetServerNewPostExecRestart(virJSONValue *object, _("Malformed max_anonymous_clients data in JSON= document")); return NULL; } + if (max_clients < max_anonymous_clients) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("The overall maximum number of clients must n= ot be less " + "than the number of clients waiting for authe= ntication")); + return NULL; + } } else { max_anonymous_clients =3D max_clients; } --=20 2.39.0