From nobody Mon Nov 23 04:18:16 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793369906; cv=none; d=zohomail.com; s=zohoarc; b=MlGubKyB3erq7XVSlNB5qcYJGRbCWovSaEdeDehw5iaJyQXEbOnzZj0Aw0dNBjwGU/QWLUXKFfaePAQBWGfzjRGlqgYVjXzozHcn1rBFSaZp//DI3jzhLxFBzNKdeuGk8JxvWTNdraeR1IN/kln6uzKJT0YsA/7pT/LqpjhGSMk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793369906; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7mqwlJ2cpKXvG3aCVAUW6xKejx28WZYL1+my44fhoRE=; b=FXX1S/kWNQnUf84UCwUok6WnD7qOs6q4m7fMxsUmsQHchz01osaLcD+9WG8ulpi7tFlimXsvMXlMRYFnJc8nUhVO2Bhr71y010GqVeY212E5j19/LmrUQTupkoiWz9D7OJux2A0MNxQi4FdnTCVgM3qbbb+CkxZWbHZPNB8TJsg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793369906340464.0369191465884; Fri, 30 Oct 2026 07:18:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMnQE-0002Sp-5u; Fri, 30 Oct 2026 10:17:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMnQA-0002Rr-3Z for qemu-devel@nongnu.org; Fri, 30 Oct 2026 10:17:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMnQ8-0002ol-Fm for qemu-devel@nongnu.org; Fri, 30 Oct 2026 10:17:29 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-131-lA6IkVTiND6l7LpWhxEitg-1; Fri, 30 Oct 2026 10:17:20 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B6A311956049; Fri, 30 Oct 2026 14:17:18 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1F50F1800480; Fri, 30 Oct 2026 14:17:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793369847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7mqwlJ2cpKXvG3aCVAUW6xKejx28WZYL1+my44fhoRE=; b=S+RDiYEmTkyAWq+kD1JjMXogNG+R7cTPugHRdKyQel9YPy6Y+GYc4dzFsAqIBLBdYZMFJe 1K8lscPikQ946KuKr7wTMyQjbrsoNd012n1HqcgieE9ebKE2ATsLDvLCSQi6Vdpiczkvws mTJCoUljoZQHlX2tU44Z6ezrRWPWL7Q= X-MC-Unique: lA6IkVTiND6l7LpWhxEitg-1 X-Mimecast-MFC-AGG-ID: lA6IkVTiND6l7LpWhxEitg_1793369839 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , Pierrick Bouvier , Paolo Bonzini , Michael Roth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake Subject: [PATCH v2 1/8] qapi: make 'CompatPolicy' the first arg in compat_policy_input_ok Date: Fri, 30 Oct 2026 14:17:06 +0000 Message-ID: <20261030141713.2841710-2-berrange@redhat.com> In-Reply-To: <20261030141713.2841710-1-berrange@redhat.com> References: <20261030141713.2841710-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793369907330158500 The typical API design pattern is for a method to be named after the type of the first arg passed into the method. For the compat_policy_input_ok method, this points towards 'CompatPolicy' being the first arg, matching compat_policy_check_security. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster --- include/qapi/compat-policy.h | 4 ++-- qapi/qapi-util.c | 16 ++++++++-------- qapi/qapi-visit-core.c | 4 ++-- qapi/qmp-dispatch.c | 2 +- qapi/qobject-input-visitor.c | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/qapi/compat-policy.h b/include/qapi/compat-policy.h index f5af2090692..df87d716439 100644 --- a/include/qapi/compat-policy.h +++ b/include/qapi/compat-policy.h @@ -18,8 +18,8 @@ =20 extern CompatPolicy compat_policy; =20 -bool compat_policy_input_ok(uint64_t features, - const CompatPolicy *policy, +bool compat_policy_input_ok(const CompatPolicy *policy, + uint64_t features, ErrorClass error_class, const char *kind, const char *name, Error **errp); diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index 38b1cec7a41..93898f57a05 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -19,8 +19,8 @@ =20 CompatPolicy compat_policy; =20 -static bool compat_policy_input_ok1(const char *adjective, - CompatPolicyInput policy, +static bool compat_policy_input_ok1(CompatPolicyInput policy, + const char *adjective, ErrorClass error_class, const char *kind, const char *name, Error **errp) @@ -38,21 +38,21 @@ static bool compat_policy_input_ok1(const char *adjecti= ve, } } =20 -bool compat_policy_input_ok(uint64_t features, - const CompatPolicy *policy, +bool compat_policy_input_ok(const CompatPolicy *policy, + uint64_t features, ErrorClass error_class, const char *kind, const char *name, Error **errp) { if ((features & 1u << QAPI_DEPRECATED) - && !compat_policy_input_ok1("Deprecated", - policy->deprecated_input, + && !compat_policy_input_ok1(policy->deprecated_input, + "Deprecated", error_class, kind, name, errp)) { return false; } if ((features & (1u << QAPI_UNSTABLE)) - && !compat_policy_input_ok1("Unstable", - policy->unstable_input, + && !compat_policy_input_ok1(policy->unstable_input, + "Unstable", error_class, kind, name, errp)) { return false; } diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c index 706c61e0260..66d57dd447a 100644 --- a/qapi/qapi-visit-core.c +++ b/qapi/qapi-visit-core.c @@ -410,8 +410,8 @@ static bool input_type_enum(Visitor *v, const char *nam= e, int *obj, } =20 if (lookup->features - && !compat_policy_input_ok(lookup->features[value], - &v->compat_policy, + && !compat_policy_input_ok(&v->compat_policy, + lookup->features[value], ERROR_CLASS_GENERIC_ERROR, "value", enum_str, errp)) { return false; diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index 965cad64998..f2fb8f7976c 100644 --- a/qapi/qmp-dispatch.c +++ b/qapi/qmp-dispatch.c @@ -185,7 +185,7 @@ QDict *coroutine_mixed_fn qmp_dispatch(const QmpCommand= List *cmds, QObject *requ "The command %s has not been found", command); goto out; } - if (!compat_policy_input_ok(cmd->features, &compat_policy, + if (!compat_policy_input_ok(&compat_policy, cmd->features, ERROR_CLASS_COMMAND_NOT_FOUND, "command", command, &err)) { goto out; diff --git a/qapi/qobject-input-visitor.c b/qapi/qobject-input-visitor.c index c52d36997df..17d91746d3a 100644 --- a/qapi/qobject-input-visitor.c +++ b/qapi/qobject-input-visitor.c @@ -667,7 +667,7 @@ static bool qobject_input_policy_reject(Visitor *v, con= st char *name, uint64_t features, Error **errp) { - return !compat_policy_input_ok(features, &v->compat_policy, + return !compat_policy_input_ok(&v->compat_policy, features, ERROR_CLASS_GENERIC_ERROR, "parameter", name, errp); } --=20 2.56.0 From nobody Mon Nov 23 04:18:16 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793369880; cv=none; d=zohomail.com; s=zohoarc; b=FdDmMZQFvYv2E6I+xcqOgAXf2i32+dzyonHCuCQ0zxif3QWx6yvs8O4dSy86dXovWTHLSRpo2JQHXB5zB0jqyOSfQvie0vQGPITG/RoMnODP0CicrYrGq+hQ3td3gpQ9QoKV2SbTntQNjysPM9plEcm34yd9DlXMiNl3auEhZxc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793369880; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8ojs5xRySK+Mw6CiLRGGC4fDVCsaMoMBV2xhVwdNOvs=; b=QokKByJ/dbqnDrfcfj85s3/2gd58u2yKwb8R2PPWNE7eaJlMIIP7B5zw0Pu8E3jg4ptdxaE/oTcEs32D6vDAXf9sP8GfGLJPRtXwzeQpJf8JndqGJrV+jDLRzmSjRpVFxqM8N3OJzI6LkXqFzcxTowmJ7Pqbp0OA4ji+11NvZ1M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793369880022921.4560858096746; Fri, 30 Oct 2026 07:18:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMnQF-0002Sz-0w; Fri, 30 Oct 2026 10:17:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMnQ9-0002Ro-1D for qemu-devel@nongnu.org; Fri, 30 Oct 2026 10:17:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMnQ7-0002oh-A6 for qemu-devel@nongnu.org; Fri, 30 Oct 2026 10:17:28 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-631-NXocZY1_OIa-7abEljVFeg-1; Fri, 30 Oct 2026 10:17:21 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C233B1955F1E; Fri, 30 Oct 2026 14:17:20 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2CF431800480; Fri, 30 Oct 2026 14:17:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793369846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8ojs5xRySK+Mw6CiLRGGC4fDVCsaMoMBV2xhVwdNOvs=; b=E1sJ9csZQA5oeHFrbm7fX6irVoTA0qYpeb2yph96TPiZ8TCsMwWf/E+8MENfax/iNCb7w7 qsw/yR/zS9E6UFagcaeFQxzZmcw2fI7FnjCo/W1YWoibUeOodgl59IwxnFuwaD7VM566ZS c7BnV8su1uDq75nJT3+oXPlb8VbjXx4= X-MC-Unique: NXocZY1_OIa-7abEljVFeg-1 X-Mimecast-MFC-AGG-ID: NXocZY1_OIa-7abEljVFeg_1793369840 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , Pierrick Bouvier , Paolo Bonzini , Michael Roth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake Subject: [PATCH v2 2/8] qapi: add 'warn' option to CompatPolicyInput Date: Fri, 30 Oct 2026 14:17:07 +0000 Message-ID: <20261030141713.2841710-3-berrange@redhat.com> In-Reply-To: <20261030141713.2841710-1-berrange@redhat.com> References: <20261030141713.2841710-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793369883167158500 This prints a warning on stderr every time a policy violation is encountered, but accepts the input. Warning every time is known to be annoying and sub-optimal, but the normal trick of using warn_report_once() isn't possible in this scenario. As a result 'warn' is not set as the default policy at this time, despite other manually placed deprecation warnings being emitted by default. Future work will consider ways to reduce the warnings to be once only, which would unlock the ability to use 'warn' by default. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster --- qapi/compat.json | 7 ++++++- qapi/qapi-util.c | 4 ++++ qemu-options.hx | 14 ++++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/qapi/compat.json b/qapi/compat.json index 0f90ea1f524..60591468ec0 100644 --- a/qapi/compat.json +++ b/qapi/compat.json @@ -17,10 +17,15 @@ # # @crash: abort() the process # +# @warn: Accept with warnings printed to stderr (Since: 11.2) +# +# .. note:: at this time, warnings will be printed on every policy +# check failure rather than once only. +# # Since: 6.0 ## { 'enum': 'CompatPolicyInput', - 'data': [ 'accept', 'reject', 'crash' ] } + 'data': [ 'accept', 'reject', 'crash', 'warn' ] } =20 ## # @CompatPolicyOutput: diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index 93898f57a05..fe0a6a57c85 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -28,6 +28,10 @@ static bool compat_policy_input_ok1(CompatPolicyInput po= licy, switch (policy) { case COMPAT_POLICY_INPUT_ACCEPT: return true; + case COMPAT_POLICY_INPUT_WARN: + warn_report("%s %s %s accepted by policy", + adjective, kind, name); + return true; case COMPAT_POLICY_INPUT_REJECT: error_set(errp, error_class, "%s %s %s disabled by policy", adjective, kind, name); diff --git a/qemu-options.hx b/qemu-options.hx index f72f30e246d..854341e7a07 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4693,9 +4693,9 @@ DEFHEADING() DEFHEADING(Debug/Expert options:) =20 DEF("compat", HAS_ARG, QEMU_OPTION_compat, - "-compat [deprecated-input=3Daccept|reject|crash][,deprecated-output= =3Daccept|hide]\n" + "-compat [deprecated-input=3Daccept|reject|crash|warn][,deprecated-out= put=3Daccept|hide]\n" " Policy for handling deprecated management interfaces\= n" - "-compat [unstable-input=3Daccept|reject|crash][,unstable-output=3Dacc= ept|hide]\n" + "-compat [unstable-input=3Daccept|reject|crash|warn][,unstable-output= =3Daccept|hide]\n" " Policy for handling unstable management interfaces\n", QEMU_ARCH_ALL) SRST @@ -4703,7 +4703,10 @@ SRST Set policy for handling deprecated management interfaces (experimental= ): =20 ``deprecated-input=3Daccept`` (default) - Accept deprecated commands and arguments + Accept deprecated commands and arguments silently + ``deprecated-input=3Dwarn`` + Accept deprecated commands and arguments with repeated warnings + on stderr ``deprecated-input=3Dreject`` Reject deprecated commands and arguments ``deprecated-input=3Dcrash`` @@ -4719,7 +4722,10 @@ SRST Set policy for handling unstable management interfaces (experimental): =20 ``unstable-input=3Daccept`` (default) - Accept unstable commands and arguments + Accept unstable commands and arguments silently + ``unstable-input=3Dwarn`` + Accept unstable commands and arguments with repeated warnings + on stderr ``unstable-input=3Dreject`` Reject unstable commands and arguments ``unstable-input=3Dcrash`` --=20 2.56.0 From nobody Mon Nov 23 04:18:16 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793369921; cv=none; d=zohomail.com; s=zohoarc; b=WBu+I4Ab5M/dPkb9NmmAHJDuzKxdzwLJK+Z+vipFDvz3ahMx1WX2Qp9/Algeo/p+t5LGSzHmi6lU0T/4KcL5r09DWKL3kABc2q26sqwQT3BjoB+n4zPzd7AYpRA9kMnAbXXjw+/qzZ41dk5WYzCdMnZLmAGNMCLfdS/WY+w3mxE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793369921; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HqLvTrUpoKCpiDVokF7a6j+p2iqFovepChBZfkThh6c=; b=SzWfn5p8Pk6iJSKe/SJEb0BqY1tnwohg55dfCINwlhXAq1RvnyNhigwryIzqyBH0h37ax+SJiplVOzBMTjr19cLWc4wo1yPoU2D6VGPdQ80Fyc5iOeFn9ynWyTaCu5CqPoVS09a6kFct2971vazRfLr125alRfRDh0GA1lOh9rU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793369921708555.3544065085849; Fri, 30 Oct 2026 07:18:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMnQH-0002T7-4m; Fri, 30 Oct 2026 10:17:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMnQA-0002Ry-F2 for qemu-devel@nongnu.org; Fri, 30 Oct 2026 10:17:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMnQ9-0002oq-1u for qemu-devel@nongnu.org; Fri, 30 Oct 2026 10:17:30 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-669-YKLGxFIcMDaWA9CYd9eevg-1; Fri, 30 Oct 2026 10:17:23 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D14E51955E97; Fri, 30 Oct 2026 14:17:22 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3A8A41800347; Fri, 30 Oct 2026 14:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793369848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HqLvTrUpoKCpiDVokF7a6j+p2iqFovepChBZfkThh6c=; b=FLskoT5jGZD6jwQdk0fGe6USDA5v4aGq6xmLndqYk6zOoo/+O+ftMdDsRvmI+DX+t3rVyt dWtuUSynX2aJywO3O9Eiv81lou1p61SBk17gqlaSnd0evUWOO/nFN9RpuCxWHwb/OWVrvl pzW4ubaqzl1WE+RO1bWEeFWlXZSLW60= X-MC-Unique: YKLGxFIcMDaWA9CYd9eevg-1 X-Mimecast-MFC-AGG-ID: YKLGxFIcMDaWA9CYd9eevg_1793369842 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , Pierrick Bouvier , Paolo Bonzini , Michael Roth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake Subject: [PATCH v2 3/8] qapi: rename 'insecure-types' to 'insecure-input' Date: Fri, 30 Oct 2026 14:17:08 +0000 Message-ID: <20261030141713.2841710-4-berrange@redhat.com> In-Reply-To: <20261030141713.2841710-1-berrange@redhat.com> References: <20261030141713.2841710-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793369923489158500 This provides better conceptual naming alignment with other -compat flags. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster --- docs/system/security.rst | 2 +- qapi/compat.json | 4 ++-- qapi/qapi-util.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/system/security.rst b/docs/system/security.rst index 75e39caedea..e211fdd2344 100644 --- a/docs/system/security.rst +++ b/docs/system/security.rst @@ -168,7 +168,7 @@ eligible for CVE assignment. Annotations will be extend= ed to other backend and object types over time, to make their security status explicit. =20 It is possible to control or identify the usage of types that do not offer -an explicit security boundary using the ``insecure-types`` parameter to the +an explicit security boundary using the ``insecure-input`` parameter to the ``-compat`` argument, which accepts three values: =20 * accept: usage of any type will be permitted. This is the current diff --git a/qapi/compat.json b/qapi/compat.json index 60591468ec0..61a670e3cda 100644 --- a/qapi/compat.json +++ b/qapi/compat.json @@ -80,7 +80,7 @@ # @unstable-output: how to handle unstable output (default 'accept') # (since 6.2) # -# @insecure-types: how to handle types that are not declared secure +# @insecure-input: how to handle types that are not declared secure # (default 'accept') (since 11.2) # # Since: 6.0 @@ -90,4 +90,4 @@ '*deprecated-output': 'CompatPolicyOutput', '*unstable-input': 'CompatPolicyInput', '*unstable-output': 'CompatPolicyOutput', - '*insecure-types': 'CompatPolicySecurity' } } + '*insecure-input': 'CompatPolicySecurity' } } diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index fe0a6a57c85..e5d8662f8bb 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -72,7 +72,7 @@ bool compat_policy_check_security(const CompatPolicy *pol= icy, return true; } =20 - switch (policy->insecure_types) { + switch (policy->insecure_input) { case COMPAT_POLICY_SECURITY_ACCEPT: return true; =20 --=20 2.56.0 From nobody Mon Nov 23 04:18:16 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793369882; cv=none; d=zohomail.com; s=zohoarc; b=SE7yqJ2FCmBHgJh1ed3srNcZMb5fef7yaYhAW7+CbiHP7bk0WLeEx2S0h3z58InlAAWwiGhEA+M+ulzNeRC5iJm8mCXHFLVTf339vwVe+fTn9+QXqA2swP76mjvn38u6HY62yrNtgdDAIsP6Y2JTqs/E6cbii5SvHM401nB2+cs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793369882; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EZOKkAurlwBG18/nwlsBeFl4vP2NKTrkc+UoNdVG74c=; b=TlKelXsE3BeJjKJt/fOzsKxBJ0PlkdSQ13o+WErc85tOAjT7gzIi8VtP8u2DPmnixiP/NKX3zWDwRwvIbwihhV0QYCDfN31T0oXUPxqnoj8JnzpdJDPKCaBWJLN2A03MprfE4DxBNx5t06PLSkYnpWNJAuYIzrj0axbmYUp0CqU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793369882677272.9054510920213; Fri, 30 Oct 2026 07:18:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMnQV-0002cb-Um; Fri, 30 Oct 2026 10:17:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMnQI-0002Ve-A8 for qemu-devel@nongnu.org; Fri, 30 Oct 2026 10:17:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMnQG-0002pf-L7 for qemu-devel@nongnu.org; Fri, 30 Oct 2026 10:17:38 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-518-QKDy1oFzP9SJh4CyFKlhOQ-1; Fri, 30 Oct 2026 10:17:26 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4F9B01955EAC; Fri, 30 Oct 2026 14:17:25 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 574EA1800347; Fri, 30 Oct 2026 14:17:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793369855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EZOKkAurlwBG18/nwlsBeFl4vP2NKTrkc+UoNdVG74c=; b=SMlytwUlF7EJk+Hn3eaLjeX3BQRr5J/1zXQdvpBOcNrJ8fGPwCxIles8Y9qheYBpYMgKKF PqfeHnJ5bCcg8vHammeCV1j66qJcfMsmF9dscJBbHsww1QU4x4Z+5qwCnd/QRcq86wPDFD KLFt7N+md1Orz/qwEEpnONbqHfG4MRU= X-MC-Unique: QKDy1oFzP9SJh4CyFKlhOQ-1 X-Mimecast-MFC-AGG-ID: QKDy1oFzP9SJh4CyFKlhOQ_1793369845 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , Pierrick Bouvier , Paolo Bonzini , Michael Roth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 4/8] qapi: drop CompatPolicySecurity and use CompatPolicyInput Date: Fri, 30 Oct 2026 14:17:09 +0000 Message-ID: <20261030141713.2841710-5-berrange@redhat.com> In-Reply-To: <20261030141713.2841710-1-berrange@redhat.com> References: <20261030141713.2841710-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793369885087158500 With 'CompatPolicyInput' gaining a 'warn' option, the 'insecure-input' option can use the 'CompatPolicySecurity' type, dropping the former. This replacement means that the 'insecure-input' option gains the ability use the 'crash' policy option. Note the error message for insecure-input changes from Type 'rtl8139' does not provide a security boundary to protect against untrusted data or actions To Insecure QOM type rtl8139 disabled by policy This type does does not provide a security boundary to protect against untrusted data or actions Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Markus Armbruster --- qapi/compat.json | 18 +----------------- qapi/qapi-util.c | 26 +++++++++++--------------- 2 files changed, 12 insertions(+), 32 deletions(-) diff --git a/qapi/compat.json b/qapi/compat.json index 61a670e3cda..10f1977def2 100644 --- a/qapi/compat.json +++ b/qapi/compat.json @@ -40,22 +40,6 @@ { 'enum': 'CompatPolicyOutput', 'data': [ 'accept', 'hide' ] } =20 -## -# @CompatPolicySecurity: -# Policy for handling any devices or backends which do not provide -# a security boundary to protect against untrusted environments -# -# @accept: Allow any usage -# -# @reject: Reject with an error reported -# -# @warn: Allow any usage, with a warning reported -# -# Since: 11.2 -## -{ 'enum': 'CompatPolicySecurity', - 'data': [ 'accept', 'reject', 'warn' ] } - ## # @CompatPolicy: # Policy for handling deprecated management interfaces. @@ -90,4 +74,4 @@ '*deprecated-output': 'CompatPolicyOutput', '*unstable-input': 'CompatPolicyInput', '*unstable-output': 'CompatPolicyOutput', - '*insecure-input': 'CompatPolicySecurity' } } + '*insecure-input': 'CompatPolicyInput' } } diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index e5d8662f8bb..e8ecc7346bb 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -16,6 +16,7 @@ #include "qemu/ctype.h" #include "qemu/error-report.h" #include "qapi/qmp/qerror.h" +#include "qapi/error.h" =20 CompatPolicy compat_policy; =20 @@ -68,27 +69,22 @@ bool compat_policy_check_security(const CompatPolicy *p= olicy, bool is_secure, Error **errp) { + ERRP_GUARD(); + if (is_secure) { return true; } =20 - switch (policy->insecure_input) { - case COMPAT_POLICY_SECURITY_ACCEPT: - return true; - - case COMPAT_POLICY_SECURITY_REJECT: - error_setg(errp, "Type '%s' does not provide a security boundary " - "to protect against untrusted data or actions", typenam= e); + if (!compat_policy_input_ok1(policy->insecure_input, + "Insecure", + ERROR_CLASS_GENERIC_ERROR, + "QOM type", typename, errp)) { + error_append_hint(errp, "This type does does not provide a " + "security boundary to protect against " + "untrusted data or actions\n"); return false; - - case COMPAT_POLICY_SECURITY_WARN: - warn_report("Type '%s' does not provide a security boundary " - "to protect against untrusted data or actions", typena= me); - return true; - - default: - g_assert_not_reached(); } + return true; } =20 =20 --=20 2.56.0 From nobody Mon Nov 23 04:18:16 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793369900; cv=none; d=zohomail.com; s=zohoarc; b=Inq5I2JNpIoH77DEiKxea9PgT/6osKOMcdh0UgLSeI2/Owt8ovA3+W+1vcGoLSTTG7ZUXWooOKiUa7/HMOZZfITNeugnxAw/x1Un4daEqPFL78SHKRv86MLt+R0xF+FAKaa7Z92QxZIihOYvRXAxmv+4bHSoh/trG1F75yokY0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793369900; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hg4m0qnP4zApKR9oX18gAhUpWkWXdYL/ayjjVX4YKRI=; b=LVqfO5mJy3NwTyqclUCt5XwQo8gNerr8yR4Rq6qQK52G3zj+aOYa37DnXls49K5v0nZdaqI164TJ7IwYZRH2+/7NLUC3bsRtVs0psRd3GATLs1aHc4eX4Z6yK+xHiuv5GizXOyF31vnV6LhcNZKPiXUySulgtIXH6oLH3sPBuT0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793369900098309.0531289858302; Fri, 30 Oct 2026 07:18:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMnQM-0002Wv-Nv; Fri, 30 Oct 2026 10:17:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMnQD-0002Sm-Uq for qemu-devel@nongnu.org; Fri, 30 Oct 2026 10:17:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMnQC-0002pI-DW for qemu-devel@nongnu.org; Fri, 30 Oct 2026 10:17:33 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-357-1nNWhZZ3OYOuS1vTvqXyyg-1; Fri, 30 Oct 2026 10:17:28 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4D68818021F7; Fri, 30 Oct 2026 14:17:27 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9FD5318004D2; Fri, 30 Oct 2026 14:17:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793369851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hg4m0qnP4zApKR9oX18gAhUpWkWXdYL/ayjjVX4YKRI=; b=ACK2wGOkD7qTclGPRufQKJwb1R7+oVqkQOulTpXBeLeN0pgSLec/dZ+wTZ/mpA3EwlXHLE ibFFQJqeI0dad0zG2dp/oRj7FZGAOR1InyZQN2kq7ws/3FqouQAWlf8/QZZJ3foPJ4kST7 5NBGuVyTjEv4A97gAEa/XNCGh8cC/r4= X-MC-Unique: 1nNWhZZ3OYOuS1vTvqXyyg-1 X-Mimecast-MFC-AGG-ID: 1nNWhZZ3OYOuS1vTvqXyyg_1793369847 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , Pierrick Bouvier , Paolo Bonzini , Michael Roth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake Subject: [PATCH v2 5/8] qapi: rename compat_policy_check_security method Date: Fri, 30 Oct 2026 14:17:10 +0000 Message-ID: <20261030141713.2841710-6-berrange@redhat.com> In-Reply-To: <20261030141713.2841710-1-berrange@redhat.com> References: <20261030141713.2841710-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793369901144158500 Rename to compat_policy_security_ok to match the naming convention established by compat_policy_input_ok. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster --- include/qapi/compat-policy.h | 8 ++++---- qapi/qapi-util.c | 8 ++++---- qom/object.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/qapi/compat-policy.h b/include/qapi/compat-policy.h index df87d716439..b7b543ffe74 100644 --- a/include/qapi/compat-policy.h +++ b/include/qapi/compat-policy.h @@ -24,10 +24,10 @@ bool compat_policy_input_ok(const CompatPolicy *policy, const char *kind, const char *name, Error **errp); =20 -bool compat_policy_check_security(const CompatPolicy *policy, - const char *typename, - bool is_secure, - Error **errp); +bool compat_policy_security_ok(const CompatPolicy *policy, + const char *typename, + bool is_secure, + Error **errp); =20 /* * Create a QObject input visitor for @obj for use with QMP diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index e8ecc7346bb..806533c7b3d 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -64,10 +64,10 @@ bool compat_policy_input_ok(const CompatPolicy *policy, return true; } =20 -bool compat_policy_check_security(const CompatPolicy *policy, - const char *typename, - bool is_secure, - Error **errp) +bool compat_policy_security_ok(const CompatPolicy *policy, + const char *typename, + bool is_secure, + Error **errp) { ERRP_GUARD(); =20 diff --git a/qom/object.c b/qom/object.c index 96498f3d001..ceb8e9eebec 100644 --- a/qom/object.c +++ b/qom/object.c @@ -3276,10 +3276,10 @@ void object_class_property_set_description(ObjectCl= ass *klass, =20 bool object_class_check_security(ObjectClass *klass, Error **errp) { - return compat_policy_check_security(&compat_policy, - object_class_get_name(klass), - object_class_is_secure(klass), - errp); + return compat_policy_security_ok(&compat_policy, + object_class_get_name(klass), + object_class_is_secure(klass), + errp); } =20 static void object_class_init(ObjectClass *klass, const void *data) --=20 2.56.0 From nobody Mon Nov 23 04:18:16 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793369907; cv=none; d=zohomail.com; s=zohoarc; b=Yk4wTQbw0qB7JRNwa6+cK0y37LYUspBsmuuDgFyAaNM+uNKwrCEgiHGLGJIpFC7DYeToAlwJkcq8eICR5d8o7dEfP7V+9DsGZF/BocMjc+/nIIgxzKYsIUUMGRXAjo8RwGNDc3BIf1w0yuB6KdjxTVg/dRsk94f6wOpxO4nUVmQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793369907; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JOD6cDuPP+RwplStS1DMh0CA8/74tl5e5XAEVILvuHI=; b=VrogiQcTsEmgyZ1pyWhlHmabZSRpNSZtVMTVANU3mVslZEWSfjzC8/NLh66nyeVX3l/kVeJRZ9eXs2SPz16YQE7fqiHPZ990WiJrqiqtXd5y/b4Ksruth1ecrJVnL4OqicEVZrLyLyW0p+kIPoE9NgqOquDOfjpXiBVlmuWJL1Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793369907065284.4018426049587; Fri, 30 Oct 2026 07:18:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMnQi-0002rI-Fr; Fri, 30 Oct 2026 10:18:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMnQH-0002Um-71 for qemu-devel@nongnu.org; Fri, 30 Oct 2026 10:17:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMnQF-0002pW-ID for qemu-devel@nongnu.org; Fri, 30 Oct 2026 10:17:36 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-128-idIDAu8cORe2MEbJGZt9pg-1; Fri, 30 Oct 2026 10:17:30 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 407821955EBA; Fri, 30 Oct 2026 14:17:29 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A00301800347; Fri, 30 Oct 2026 14:17:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793369854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JOD6cDuPP+RwplStS1DMh0CA8/74tl5e5XAEVILvuHI=; b=K0+rZksVddDo5Wtm2xFqkcIRZekfoW9M27cx0mEntTxtrPUHeRPwBJJ8FjaIN6ufglBJOU jBQAjJggf1LIRSRJVd7QAxG6hyfHgEhbqNtsVcg38La/PcPfXxBNgDik9/1UsiVZx/i5hL oK7MnD7cOxgm95za+FKuc12XsM2Il7I= X-MC-Unique: idIDAu8cORe2MEbJGZt9pg-1 X-Mimecast-MFC-AGG-ID: idIDAu8cORe2MEbJGZt9pg_1793369849 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , Pierrick Bouvier , Paolo Bonzini , Michael Roth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake Subject: [PATCH v2 6/8] qapi: reverse arg order in compat_policy_security_ok Date: Fri, 30 Oct 2026 14:17:11 +0000 Message-ID: <20261030141713.2841710-7-berrange@redhat.com> In-Reply-To: <20261030141713.2841710-1-berrange@redhat.com> References: <20261030141713.2841710-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793369910159154100 Match the compat_policy_input_ok design more closely by having the "relevant facts" being checked as the 2nd argument. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster --- include/qapi/compat-policy.h | 2 +- qapi/qapi-util.c | 2 +- qom/object.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/qapi/compat-policy.h b/include/qapi/compat-policy.h index b7b543ffe74..53c96ce1a26 100644 --- a/include/qapi/compat-policy.h +++ b/include/qapi/compat-policy.h @@ -25,8 +25,8 @@ bool compat_policy_input_ok(const CompatPolicy *policy, Error **errp); =20 bool compat_policy_security_ok(const CompatPolicy *policy, - const char *typename, bool is_secure, + const char *typename, Error **errp); =20 /* diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index 806533c7b3d..29d01653e77 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -65,8 +65,8 @@ bool compat_policy_input_ok(const CompatPolicy *policy, } =20 bool compat_policy_security_ok(const CompatPolicy *policy, - const char *typename, bool is_secure, + const char *typename, Error **errp) { ERRP_GUARD(); diff --git a/qom/object.c b/qom/object.c index ceb8e9eebec..30699f91279 100644 --- a/qom/object.c +++ b/qom/object.c @@ -3277,8 +3277,8 @@ void object_class_property_set_description(ObjectClas= s *klass, bool object_class_check_security(ObjectClass *klass, Error **errp) { return compat_policy_security_ok(&compat_policy, - object_class_get_name(klass), object_class_is_secure(klass), + object_class_get_name(klass), errp); } =20 --=20 2.56.0 From nobody Mon Nov 23 04:18:16 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793369907; cv=none; d=zohomail.com; s=zohoarc; b=RQ9cNl3g8rULdS2kPkhJDepCkttB3FrO+O5ofAXzp+meKR+oDWP5oTRcneK+B+UGR8fQDTJsflwtaesBKV1Hso00dxepumyizuYHYy9fewngti86iADhEGyHd2ZJOH3KprmaLiUtxRYQymTfhHTAfockZX5A5JCSfJ2RxIy2TSM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793369907; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EE9JxlguqZcZ4uic8sGueLBZLsRv4rO+wuswEaNRj1o=; b=UMgmyPRPXp5UjSvmO9ActMnLjwPequ1NchyVt9KdnJunLUVBmoBUAlXQ/O6Ri7jkvsnkAwVxWwshyt5S9z6oqXRLPfeFHP5Pq9I2AT/yuz3uVvbdQiKT25GzWPygyZi+oRYxoC4PTcOahyTt7uX0oURD0Vkf2ApLuuvdnZYZxsM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793369907309257.23504805858886; Fri, 30 Oct 2026 07:18:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMnQM-0002WZ-Mc; Fri, 30 Oct 2026 10:17:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMnQF-0002TG-P4 for qemu-devel@nongnu.org; Fri, 30 Oct 2026 10:17:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMnQE-0002pN-61 for qemu-devel@nongnu.org; Fri, 30 Oct 2026 10:17:35 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-365-s5v3ufbUNKWQX2Y3Qh_zaA-1; Fri, 30 Oct 2026 10:17:32 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3160D1801BD5; Fri, 30 Oct 2026 14:17:31 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9153E1800480; Fri, 30 Oct 2026 14:17:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793369853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EE9JxlguqZcZ4uic8sGueLBZLsRv4rO+wuswEaNRj1o=; b=HepLykSkKV+C0dcvFpSK3PIiNMBe4rbKacSdp/FOI+2kYtTGzVUix2a4+Kgh6eZm6jtgvv 5yHYCrmrPs11hg6Vr32QbCf7Iuz3wA48ex5RjC/kNO/Vh5eP2LLb9AtEW4ooSEwuAvwiMR XQ9Dr2q2wfBzRuR7M4AUKfTvyMGYcew= X-MC-Unique: s5v3ufbUNKWQX2Y3Qh_zaA-1 X-Mimecast-MFC-AGG-ID: s5v3ufbUNKWQX2Y3Qh_zaA_1793369851 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , Pierrick Bouvier , Paolo Bonzini , Michael Roth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake Subject: [PATCH v2 7/8] qemu-options: document -compat insecure-input parameter Date: Fri, 30 Oct 2026 14:17:12 +0000 Message-ID: <20261030141713.2841710-8-berrange@redhat.com> In-Reply-To: <20261030141713.2841710-1-berrange@redhat.com> References: <20261030141713.2841710-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793369910170154100 This adds documentation for the previously added 'insecure-input' parameter to -compat, which controls policy for insecure configuration requests. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster --- qemu-options.hx | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index 854341e7a07..0b8e6d0d8a9 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4696,7 +4696,9 @@ DEF("compat", HAS_ARG, QEMU_OPTION_compat, "-compat [deprecated-input=3Daccept|reject|crash|warn][,deprecated-out= put=3Daccept|hide]\n" " Policy for handling deprecated management interfaces\= n" "-compat [unstable-input=3Daccept|reject|crash|warn][,unstable-output= =3Daccept|hide]\n" - " Policy for handling unstable management interfaces\n", + " Policy for handling unstable management interfaces\n" + "-compat [insecure-input=3Daccept|reject|crash|warn]\n" + " Policy for handling insecure configuration requests\n= ", QEMU_ARCH_ALL) SRST ``-compat [deprecated-input=3D][,deprecated-output=3D]`` @@ -4736,6 +4738,25 @@ SRST Suppress unstable command results and events =20 Limitation: covers only syntactic aspects of QMP. + +``-compat [insecure-input=3D]`` + Set policy for handling insecure configuration requests: + + ``insecure-input=3Daccept`` (default) + Accept insecure configurations requests silently + ``insecure-input=3Dwarn`` + Accept insecure configuration requests with warning repeated + warnings on stderr + ``insecure-input=3Dreject`` + Reject insecure configuration requests + ``insecure-input=3Dcrash`` + Crash on insecure configuration requests + + Limitation: an insecure configuration is one where QEMU does + not provide a security boundary to protect against malicious + usage / untrusted data. Covers only user creatable QOM types + for devices, machine types and accelerators. Implicitly created + QOM types and parent types are not checked at this time. ERST =20 DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg, --=20 2.56.0 From nobody Mon Nov 23 04:18:16 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793369907; cv=none; d=zohomail.com; s=zohoarc; b=ha9mGqMC4eztj86o5KrYb8rU/0UR4nurAI/+/yWHYX+ytoJl355zufTlqE2cccIVDPV39KlTjyZiDNWBYDWQ998IcxgSBMA28bu0RU4PVhEsV7YrlO5+07R3L+xsIRYn8OOXtRQLrvrbOr+tTM1Xgt4Ce6i6zGhVu3XUnTO0XMg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793369907; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=quSRLvHYGU1qYnvNN/1YDpm2/UV9TANpRtX09mmh5G8=; b=iuChPoezn0pkG7it90SB6968lERzSZFdWRm5rAr4+RakOnLTTT6Petzinp2EyNILkN1x1Ji5s9Hodt0EcYrLne14lxP8s+3JuYY1Nu2InJtdPeLwcPcHjcxx8Tn6Z26c6870U9+lvXkbCqHBptdCEchqod/zVx858+O27s00m5U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793369907611201.9951611763222; Fri, 30 Oct 2026 07:18:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMnQb-0002gB-R7; Fri, 30 Oct 2026 10:18:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMnQI-0002Vf-LH for qemu-devel@nongnu.org; Fri, 30 Oct 2026 10:17:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMnQG-0002ph-Qb for qemu-devel@nongnu.org; Fri, 30 Oct 2026 10:17:38 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-360-EF50fKriPfGyM0O9NNxBCg-1; Fri, 30 Oct 2026 10:17:34 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 313C01800752; Fri, 30 Oct 2026 14:17:33 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 847031800480; Fri, 30 Oct 2026 14:17:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793369856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=quSRLvHYGU1qYnvNN/1YDpm2/UV9TANpRtX09mmh5G8=; b=HJfZSujh5EZglK4sse/dgK/RMN01VGv3eUCFSzM/7su8mE3JV8oZdLZ4Teo4DZvSpuKlCn Sk5I1oFDWfVOYTJPKyrD8CfZNiGjmVmOn3eg1xGpgiR+Worb2/1/3sibaUL7QsrtusUN/K Y4A3PUyDaq6YIHiz8Sk9XgdSGkuqjgg= X-MC-Unique: EF50fKriPfGyM0O9NNxBCg-1 X-Mimecast-MFC-AGG-ID: EF50fKriPfGyM0O9NNxBCg_1793369853 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , Pierrick Bouvier , Paolo Bonzini , Michael Roth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake Subject: [PATCH v2 8/8] qapi: print a message before aborting for -compat violations Date: Fri, 30 Oct 2026 14:17:13 +0000 Message-ID: <20261030141713.2841710-9-berrange@redhat.com> In-Reply-To: <20261030141713.2841710-1-berrange@redhat.com> References: <20261030141713.2841710-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793369910228154100 When using the 'crash' policy with -compat options, QEMU will abort() on a policy violation. All the user sees is a core dump though and while the stack trace will ultimately show what the violation was, it can be hard to reverse engineer the cause when variables are optimized out. If the crash is within a CI system, it can be even harder to determine what the cause was as a core dump may not be available. Printing a message when crashing is easier to diagnose when limited context is available. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster --- qapi/qapi-util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index 29d01653e77..7067b4ddf67 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -38,6 +38,9 @@ static bool compat_policy_input_ok1(CompatPolicyInput pol= icy, adjective, kind, name); return false; case COMPAT_POLICY_INPUT_CRASH: + error_report("%s %s %s disabled by policy, aborting", + adjective, kind, name); + /* fallthrough */ default: abort(); } --=20 2.56.0