From nobody Fri Apr 19 20:02:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631143256; cv=none; d=zohomail.com; s=zohoarc; b=a59reUyCmll6X0t24LqmaILwF4x0nGMVsD/SLvaUYSlHzyt/z/w3OIJXjLGs1eoLj7eD/wAhuz3G6/YVnHQjQOiU9eO9pCDSE1wtNbf73PMWfMgi96UggQAtzW5w002kdHETs8j0Hq767csgJaBJd37D4bqqHvZW4mO0wm9Q4kQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631143256; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=24r6QApw3vBXmuZyf+4hmvAM+x9sjvcUeNKNebXV07M=; b=EpRjDcSeEWk/b+nE0mZAyZoRcRJN1zesS+zEJZM++b9uAfsUzAc5TfaMTeeAdlMS1QBVsiSBU3qvkjkHdwyaQF1ah5UJ7oSVq6zOHXkPyJOgxJtzC9m50U8/av6cowhOu5Wp47DwwmSkCiNz7y22el0JF9paqaSHh+q+6VSYWig= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1631143256404865.5807447188363; Wed, 8 Sep 2021 16:20:56 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.182405.329943 (Exim 4.92) (envelope-from ) id 1mO6ru-0005Hm-Ex; Wed, 08 Sep 2021 23:20:38 +0000 Received: by outflank-mailman (output) from mailman id 182405.329943; Wed, 08 Sep 2021 23:20:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mO6ru-0005Hd-BZ; Wed, 08 Sep 2021 23:20:38 +0000 Received: by outflank-mailman (input) for mailman id 182405; Wed, 08 Sep 2021 23:20:37 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mO6rt-0005H5-57 for xen-devel@lists.xenproject.org; Wed, 08 Sep 2021 23:20:37 +0000 Received: from us-smtp-delivery-124.mimecast.com (unknown [170.10.133.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 29ae4109-0146-4d0d-9aab-02903dff8a94; Wed, 08 Sep 2021 23:20:36 +0000 (UTC) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-188-xr-uShr_OCCOqUsQg9aBEA-1; Wed, 08 Sep 2021 19:20:32 -0400 Received: by mail-wm1-f72.google.com with SMTP id h1-20020a05600c350100b002e751bf6733so27556wmq.8 for ; Wed, 08 Sep 2021 16:20:32 -0700 (PDT) Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id d24sm351621wmb.35.2021.09.08.16.20.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 16:20:30 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 29ae4109-0146-4d0d-9aab-02903dff8a94 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631143235; 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=24r6QApw3vBXmuZyf+4hmvAM+x9sjvcUeNKNebXV07M=; b=cHMSEsH74t2LvVloVlfq4EvD+YK4jqLIsSY4YFJusw8TgkB2ciE6ChM/g1pmYKdE0f9ZOJ XPBjIoKkp3S6WWLeZg8vBtc3kD6MGqMCDuJziJOhsqagrbrF1YyCwNW8JW8rlivQ5In0B6 LSsJq/esbeEV0randd9PzKnI4N0eeac= X-MC-Unique: xr-uShr_OCCOqUsQg9aBEA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=24r6QApw3vBXmuZyf+4hmvAM+x9sjvcUeNKNebXV07M=; b=OSEQ+1btCzwIP0Fjw06aUhpWT7CZ/JirzP7Qh7uRHA81iDx+/TKmGKriDqYzsIU3Qt 0QpPU6aL5Ceb0AFD2H7U3GG315dR29AZjzFvZlDb4G4wweNG95prTSd5nqwMFHCvpGdX OEceVtNGpKlh8VUdH8y0Ul1xHwmkQi1TxaMhGf03/a9BMS2WvpjTeHwjjUsS9Ao3AnTO DPCyQSdViIRS78NO+mbdtYjKdfsrGr0jplBiABg3nBLWH//w5p1kt4G6bZJkatONQYD4 dzFNmseoLFC4tclXtDcDK8CQHWcoTcNve/6hEIoGziRoazq+S5imVpqZpJpz3lHJExxm USXw== X-Gm-Message-State: AOAM533OX6TrTHtxLJU8dl6515fkYRDl0SSQ795hNvUAN8nD0pdiiKMJ RMOcjOb3p5nCgmS4XFuVYV46vOwhvCRkXsuaszn9eruDL9V8+hUObr4uuQ6kZvA74jskDRQqDTI G+aAlbPxWLMtK66MxyDzQmfsWQtM= X-Received: by 2002:a1c:a505:: with SMTP id o5mr581205wme.32.1631143231080; Wed, 08 Sep 2021 16:20:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxASJCusoNVcbOBdnL042tIJLhajKX+g6Wmf6M6mn99T6nfkEBgAxNrSyEjSzJ0g2TtZ/mq2Q== X-Received: by 2002:a1c:a505:: with SMTP id o5mr581183wme.32.1631143230848; Wed, 08 Sep 2021 16:20:30 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Prasad J Pandit , "Michael S. Tsirkin" , Markus Armbruster , Paolo Bonzini , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Richard Henderson , qemu-block@nongnu.org, Peter Maydell , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 01/10] sysemu: Introduce qemu_security_policy_taint() API Date: Thu, 9 Sep 2021 01:20:15 +0200 Message-Id: <20210908232024.2399215-2-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210908232024.2399215-1-philmd@redhat.com> References: <20210908232024.2399215-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631143256944100007 Introduce qemu_security_policy_taint() which allows unsafe (read "not very maintained") code to 'taint' QEMU security policy. The "security policy" is the @SecurityPolicy QAPI enum, composed of: - "none" (no policy, current behavior) - "warn" (display a warning when the policy is tainted, keep going) - "strict" (once tainted, exit QEMU before starting the VM) The qemu_security_policy_is_strict() helper is also provided, which will be proved useful once a VM is started (example we do not want to kill a running VM if an unsafe device is hot-added). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- qapi/run-state.json | 16 +++++++++++ include/qemu-common.h | 19 ++++++++++++ softmmu/vl.c | 67 +++++++++++++++++++++++++++++++++++++++++++ qemu-options.hx | 17 +++++++++++ 4 files changed, 119 insertions(+) diff --git a/qapi/run-state.json b/qapi/run-state.json index 43d66d700fc..b15a107fa01 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -638,3 +638,19 @@ { 'struct': 'MemoryFailureFlags', 'data': { 'action-required': 'bool', 'recursive': 'bool'} } + +## +# @SecurityPolicy: +# +# An enumeration of the actions taken when the security policy is tainted. +# +# @none: do nothing. +# +# @warn: display a warning. +# +# @strict: prohibit QEMU to start a VM. +# +# Since: 6.2 +## +{ 'enum': 'SecurityPolicy', + 'data': [ 'none', 'warn', 'strict' ] } diff --git a/include/qemu-common.h b/include/qemu-common.h index 73bcf763ed8..bf0b054bb66 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -139,4 +139,23 @@ void page_size_init(void); * returned. */ bool dump_in_progress(void); =20 +/** + * qemu_security_policy_taint: + * @tainting whether any security policy is tainted (compromised). + * @fmt: taint reason format string + * ...: list of arguments to interpolate into @fmt, like printf(). + * + * Allow unsafe code path to taint the global security policy. + * See #SecurityPolicy. + */ +void qemu_security_policy_taint(bool tainting, const char *fmt, ...) + GCC_FMT_ATTR(2, 3); + +/** + * qemu_security_policy_is_strict: + * + * Return %true if the global security policy is 'strict', %false otherwis= e. + */ +bool qemu_security_policy_is_strict(void); + #endif diff --git a/softmmu/vl.c b/softmmu/vl.c index 55ab70eb97f..92c05ac97ee 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -489,6 +489,20 @@ static QemuOptsList qemu_action_opts =3D { }, }; =20 +static QemuOptsList qemu_security_policy_opts =3D { + .name =3D "security-policy", + .implied_opt_name =3D "policy", + .merge_lists =3D true, + .head =3D QTAILQ_HEAD_INITIALIZER(qemu_security_policy_opts.head), + .desc =3D { + { + .name =3D "policy", + .type =3D QEMU_OPT_STRING, + }, + { /* end of list */ } + }, +}; + const char *qemu_get_vm_name(void) { return qemu_name; @@ -600,6 +614,52 @@ static int cleanup_add_fd(void *opaque, QemuOpts *opts= , Error **errp) } #endif =20 +static SecurityPolicy security_policy =3D SECURITY_POLICY_NONE; + +bool qemu_security_policy_is_strict(void) +{ + return security_policy =3D=3D SECURITY_POLICY_STRICT; +} + +static int select_security_policy(const char *p) +{ + int policy; + char *qapi_value; + + qapi_value =3D g_ascii_strdown(p, -1); + policy =3D qapi_enum_parse(&SecurityPolicy_lookup, qapi_value, -1, NUL= L); + g_free(qapi_value); + if (policy < 0) { + return -1; + } + security_policy =3D policy; + + return 0; +} + +void qemu_security_policy_taint(bool tainting, const char *fmt, ...) +{ + va_list ap; + g_autofree char *efmt =3D NULL; + + if (security_policy =3D=3D SECURITY_POLICY_NONE || !tainting) { + return; + } + + va_start(ap, fmt); + if (security_policy =3D=3D SECURITY_POLICY_STRICT) { + efmt =3D g_strdup_printf("%s taints QEMU security policy, exiting.= ", fmt); + error_vreport(efmt, ap); + exit(EXIT_FAILURE); + } else if (security_policy =3D=3D SECURITY_POLICY_WARN) { + efmt =3D g_strdup_printf("%s taints QEMU security policy.", fmt); + warn_vreport(efmt, ap); + } else { + g_assert_not_reached(); + } + va_end(ap); +} + /***********************************************************/ /* QEMU Block devices */ =20 @@ -2764,6 +2824,7 @@ void qemu_init(int argc, char **argv, char **envp) qemu_add_opts(&qemu_semihosting_config_opts); qemu_add_opts(&qemu_fw_cfg_opts); qemu_add_opts(&qemu_action_opts); + qemu_add_opts(&qemu_security_policy_opts); module_call_init(MODULE_INIT_OPTS); =20 error_init(argv[0]); @@ -3230,6 +3291,12 @@ void qemu_init(int argc, char **argv, char **envp) exit(1); } break; + case QEMU_OPTION_security_policy: + if (select_security_policy(optarg) =3D=3D -1) { + error_report("unknown -security-policy parameter"); + exit(1); + } + break; case QEMU_OPTION_parallel: add_device_config(DEV_PARALLEL, optarg); default_parallel =3D 0; diff --git a/qemu-options.hx b/qemu-options.hx index 8f603cc7e65..d9939f7ae1d 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4298,6 +4298,23 @@ SRST =20 ERST =20 +DEF("security-policy", HAS_ARG, QEMU_OPTION_security_policy, \ + "-security-policy none|warn|strict\n" \ + " action when security policy is tainted [default=3Dno= ne]\n", + QEMU_ARCH_ALL) +SRST +``-security-policy policy`` + The policy controls what QEMU will do when an unsecure feature is + used, tainting the process security. The default is ``none`` (do + nothing). Other possible actions are: ``warn`` (display a warning + and keep going) or ``strict`` (exits QEMU before launching a VM). + + Examples: + + ``-security-policy warn``; \ ``-security-policy strict`` + +ERST + DEF("echr", HAS_ARG, QEMU_OPTION_echr, \ "-echr chr set terminal escape character instead of ctrl-a\n", QEMU_ARCH_ALL) --=20 2.31.1 From nobody Fri Apr 19 20:02:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631143255; cv=none; d=zohomail.com; s=zohoarc; b=iau1q8lhcgTBTVpFwGbCYmfOZbog35dtnjQWQAMA8lmuZl7oTFGjWJXePMLCjv9y4PecAjLD7GkxjzQ1sfmoIgQ9tWWqzLeATa57y+mIknBmdNIl2PaPdJWHcO6YJtu9PzExMuRjLuA9XjfHzAoCFhSF7UT1ggoDrzzGmDFQkl4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631143255; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VWnIa1NnZmGclGfmWQAc+byFrHYlEtTXg6KMBnsWc1s=; b=KQJYqy97FvyE8APlUC4ZLICHPE+idQeN6Gki0j1tl48BMA/RLHFO+PifggEDpMQFS1DEA0NTHPrAT53bIp4YbuDh6Jt4rCwWVvCeMU65rNYs2aBz+RYPW2RQohZ0CLU/ZKGg8HM0xSuKVdXdyDOdE1c5UcKHdRRoWgTo1ANhfWE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1631143255508209.428377009055; Wed, 8 Sep 2021 16:20:55 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.182406.329955 (Exim 4.92) (envelope-from ) id 1mO6rw-0005Zq-PB; Wed, 08 Sep 2021 23:20:40 +0000 Received: by outflank-mailman (output) from mailman id 182406.329955; Wed, 08 Sep 2021 23:20:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mO6rw-0005Zf-Ld; Wed, 08 Sep 2021 23:20:40 +0000 Received: by outflank-mailman (input) for mailman id 182406; Wed, 08 Sep 2021 23:20:39 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mO6rv-0005Yv-Pb for xen-devel@lists.xenproject.org; Wed, 08 Sep 2021 23:20:39 +0000 Received: from us-smtp-delivery-124.mimecast.com (unknown [170.10.133.124]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 60e9c8ca-10fb-11ec-b18c-12813bfff9fa; Wed, 08 Sep 2021 23:20:39 +0000 (UTC) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-352-HPvg9sFIMMGFOrpSD9GX4g-1; Wed, 08 Sep 2021 19:20:37 -0400 Received: by mail-wm1-f71.google.com with SMTP id v2-20020a7bcb420000b02902e6b108fcf1so32012wmj.8 for ; Wed, 08 Sep 2021 16:20:37 -0700 (PDT) Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id j14sm30789wrp.21.2021.09.08.16.20.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 16:20:35 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 60e9c8ca-10fb-11ec-b18c-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631143238; 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=VWnIa1NnZmGclGfmWQAc+byFrHYlEtTXg6KMBnsWc1s=; b=CNr7uEMA9kce1mHm8iJRelPNGfg/Oj7Dn6LovQY5TTLblc8kbJOcFtS22RRLTtSaNaEl4E VLYd9KZkuGraLYmHaL3r2Jw+BHe28d/3lc1D6u88BLC7NtYOvuGSOhyDdvS8coF4RZ+KJH 4/0/Kg2IXtekjoQnjG/sd5TxZZtASz4= X-MC-Unique: HPvg9sFIMMGFOrpSD9GX4g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VWnIa1NnZmGclGfmWQAc+byFrHYlEtTXg6KMBnsWc1s=; b=RH7+oWKce2XP0YN2dFIErhB/jA8c+W2j/w03VzJZmANWkMrz2FWInpTq0m0Z0Aq73x oXb7vaIHFMzmGgbD/kL+t7yTaipEiQWYtcNDnuRvY95QtciR2wZWHpomshwxsSGTW24O EVEn6q5Bi0bxk1mBXfjwN4mRHEaoNSqRd97Kii1F9RlYFIilNXYLRUQ4NqGv1Fx485NF YYRQCdJ1p8atR+cX9p3Hj42lTEl5dNOeHOLJGQjYupxAtPxhbL1Et1reuj9h9uS7YeTr GcElue3bYxB6D8PFFAXeJeYvw5n53tC1dtZ9uuJVVeI0dB4uVHdIztZX9PF35UvWXaAG 2ACg== X-Gm-Message-State: AOAM532BP1yKPsT69m06v3Ty57MrFE5memNP3fIQWyUTWtu3n8rLWYW2 5TV1ldXz+xk1onfmn+H7yRuheQh5PspEIk+wXw8+3JTBIhXnhqqU8jhiDVRGfSQZmZy/G0Ul5ce UlRpD6DVt3RODQy5mjMIOpiVsl8M= X-Received: by 2002:a1c:448a:: with SMTP id r132mr557411wma.105.1631143236078; Wed, 08 Sep 2021 16:20:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6WkilBgiH6FuwGNniEzqjgdLM6GzbGQfLFFCepoIH7M5nhemfkyQL//fRVRjKLyNs63E1PQ== X-Received: by 2002:a1c:448a:: with SMTP id r132mr557389wma.105.1631143235880; Wed, 08 Sep 2021 16:20:35 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Prasad J Pandit , "Michael S. Tsirkin" , Markus Armbruster , Paolo Bonzini , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Richard Henderson , qemu-block@nongnu.org, Peter Maydell , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 02/10] accel: Use qemu_security_policy_taint(), mark KVM and Xen as safe Date: Thu, 9 Sep 2021 01:20:16 +0200 Message-Id: <20210908232024.2399215-3-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210908232024.2399215-1-philmd@redhat.com> References: <20210908232024.2399215-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631143256689100003 Add the AccelClass::secure_policy_supported field to classify safe (within security boundary) vs unsafe accelerators. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qemu/accel.h | 5 +++++ accel/kvm/kvm-all.c | 1 + accel/xen/xen-all.c | 1 + softmmu/vl.c | 3 +++ 4 files changed, 10 insertions(+) diff --git a/include/qemu/accel.h b/include/qemu/accel.h index 4f4c283f6fc..895e30be0de 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -44,6 +44,11 @@ typedef struct AccelClass { hwaddr start_addr, hwaddr size); #endif bool *allowed; + /* + * Whether the accelerator is withing QEMU security policy boundary. + * See: https://www.qemu.org/contribute/security-process/ + */ + bool secure_policy_supported; /* * Array of global properties that would be applied when specific * accelerator is chosen. It works like MachineClass.compat_props diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 0125c17edb8..eb6b9e44df2 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -3623,6 +3623,7 @@ static void kvm_accel_class_init(ObjectClass *oc, voi= d *data) ac->init_machine =3D kvm_init; ac->has_memory =3D kvm_accel_has_memory; ac->allowed =3D &kvm_allowed; + ac->secure_policy_supported =3D true; =20 object_class_property_add(oc, "kernel-irqchip", "on|off|split", NULL, kvm_set_kernel_irqchip, diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index 69aa7d018b2..57867af5faf 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -198,6 +198,7 @@ static void xen_accel_class_init(ObjectClass *oc, void = *data) ac->setup_post =3D xen_setup_post; ac->allowed =3D &xen_allowed; ac->compat_props =3D g_ptr_array_new(); + ac->secure_policy_supported =3D true; =20 compat_props_add(ac->compat_props, compat, G_N_ELEMENTS(compat)); =20 diff --git a/softmmu/vl.c b/softmmu/vl.c index 92c05ac97ee..e4f94e159c3 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2388,6 +2388,9 @@ static int do_configure_accelerator(void *opaque, Qem= uOpts *opts, Error **errp) return 0; } =20 + qemu_security_policy_taint(!ac->secure_policy_supported, + "%s accelerator", acc); + return 1; } =20 --=20 2.31.1 From nobody Fri Apr 19 20:02:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@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.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631143244; cv=none; d=zohomail.com; s=zohoarc; b=RQuGxZ4aMmo05tFdSSdd+MdNmc36K+E+YvV2RqjSzJ3FmVscjcpKgOUYYKQzPJUyMHmgMNy1df/zPuonxknja02OZiZJaOLtlj8Z94fC3/O0qWU0YRy6Wsa4FLN44UiVXyA3HNMqGKHJyab+7nel1ooHQSSbGJUV+uxd8mrPFq0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631143244; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=AztXDO9JQH0V78yza1WhT6PPCcwDZClDQJU1AbRxT1E=; b=HTBegLO4NzMhihjxguSWOqFO7UL6cq3mCC1fZ6bdyrvFJ0yuZxMjEHDYAQ53eIvJxU1ECBSWKKG5T7Z2sFOaS3TkEFhqgolJQoaFxYOOx9JN2Td/hyFZyLKu+KE+FZuUiXE/Q7/85PWvdFrzzRfJ27g6LxCK6zOJCzl4p9NKIDA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1631143244339486.4842951671652; Wed, 8 Sep 2021 16:20:44 -0700 (PDT) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-542-vwfzm5q7ONuf27U6LpdmRw-1; Wed, 08 Sep 2021 19:20:42 -0400 Received: by mail-wm1-f69.google.com with SMTP id v2-20020a7bcb420000b02902e6b108fcf1so32118wmj.8 for ; Wed, 08 Sep 2021 16:20:42 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id u8sm3407763wmq.45.2021.09.08.16.20.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 16:20:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631143243; 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=AztXDO9JQH0V78yza1WhT6PPCcwDZClDQJU1AbRxT1E=; b=DzNscKHD3B+rraynLTiG6CcFw3GBOY0qxjYVo/6Orqx2lRKrTmHUdjS8qLxwmpQcj7StRN Mykf0lwDYaebs39zHs5SnQpcb9VgCmEOSsSQ8VtDZoP1M16PR3lxxWqBDQNoTCfYQwlhAW wdLaQ24zI0jb7CYEshHXMM+oVlnWEZo= X-MC-Unique: vwfzm5q7ONuf27U6LpdmRw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AztXDO9JQH0V78yza1WhT6PPCcwDZClDQJU1AbRxT1E=; b=0/4fLtQPqN9Edmm0UqdMgINS/fBNPh4cQhIooXNsIK3CNuTeFFDBATMEN4ep9C0xkZ KtI1RBxN0IxzgnJ0JGHjN4Du8erZEiA87zavWajfswWgfiQ/j9r30dBehWmD3x7O/1A8 L+Bnqcef0gU4wCLYrDWXoK1Raha3NzDRfzTgliu4wUQnsEM1JU4z8CWsqLxrYV1daRWI is41aVoNQOba9aE7fuygkSv2gicyVkTpRLH005ErYc3dzYRxG0uJ5kc2LONGi3CVNOLW upIkDa8bfxPaKfAaWZjpKx19GnAHZVqGXpiUTRRDRcmouewt2+wD5GCWyKoP9yVQC6CC z86g== X-Gm-Message-State: AOAM533LmIUZZgqwQoGtFk5dJJYuvFsspejFc4XUodyP/P5EKjM1OnQd SvLdehQyVH2n2QZTSdW5x6o97imLOiIx8FAyxWQnCboT5i1CNZq2GoI9tFOcMCIUfQto8UPrxd8 ooxL6SoeFoTHAWw== X-Received: by 2002:adf:cd92:: with SMTP id q18mr84491wrj.211.1631143241056; Wed, 08 Sep 2021 16:20:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXGBcGkm4TBFmSADncXUcjFYrWCY3XIJ3gTrnp0jPkA2D2pCoYXECv5ulk3hjXuxgjKt0f9A== X-Received: by 2002:adf:cd92:: with SMTP id q18mr84482wrj.211.1631143240917; Wed, 08 Sep 2021 16:20:40 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Prasad J Pandit , "Michael S. Tsirkin" , Markus Armbruster , Paolo Bonzini , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Richard Henderson , qemu-block@nongnu.org, Peter Maydell , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 03/10] block: Use qemu_security_policy_taint() API Date: Thu, 9 Sep 2021 01:20:17 +0200 Message-Id: <20210908232024.2399215-4-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210908232024.2399215-1-philmd@redhat.com> References: <20210908232024.2399215-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631143246026100001 Add the BlockDriver::bdrv_taints_security_policy() handler. Drivers implementing it might taint the global QEMU security policy. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/block/block_int.h | 6 +++++- block.c | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index f1a54db0f8c..0ec0a5c06e9 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -169,7 +169,11 @@ struct BlockDriver { int (*bdrv_file_open)(BlockDriverState *bs, QDict *options, int flags, Error **errp); void (*bdrv_close)(BlockDriverState *bs); - + /* + * Return %true if the driver is withing QEMU security policy boundary, + * %false otherwise. See: https://www.qemu.org/contribute/security-pro= cess/ + */ + bool (*bdrv_taints_security_policy)(BlockDriverState *bs); =20 int coroutine_fn (*bdrv_co_create)(BlockdevCreateOptions *opts, Error **errp); diff --git a/block.c b/block.c index b2b66263f9a..696ba486001 100644 --- a/block.c +++ b/block.c @@ -49,6 +49,7 @@ #include "qemu/timer.h" #include "qemu/cutils.h" #include "qemu/id.h" +#include "qemu-common.h" #include "block/coroutines.h" =20 #ifdef CONFIG_BSD @@ -1587,6 +1588,11 @@ static int bdrv_open_driver(BlockDriverState *bs, Bl= ockDriver *drv, } } =20 + if (drv->bdrv_taints_security_policy) { + qemu_security_policy_taint(drv->bdrv_taints_security_policy(bs), + "Block protocol '%s'", drv->format_name= ); + } + return 0; open_failed: bs->drv =3D NULL; --=20 2.31.1 From nobody Fri Apr 19 20:02:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631143263; cv=none; d=zohomail.com; s=zohoarc; b=iiFFhRdakRsamki7dPr0XpY8jYhSUdjmW13BNhz3QlP/umTL17dLu1oy1rcobsYzveTu/mscvuuDljHIZilF/z14tYQSD4EHThJtQgXgt3LOgASa4TdtKC3QYcqZOsB9m+Izv60421TJBG3bPf6cynRpm4g3NuSpbeBGyOiG3E8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631143263; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AWN2pZpGs6sHyN/PrFeo6PGJIp1YJY+EJRzHbkMHcxk=; b=mi9LxKBL9tZQTRoQdFgMH0cK30mcJRfSnz5OB+AKSjHHHD/Oq+dAVHxCQu+fTD+hVBaz0x+J6vWX3Cvh/dl4i9EFte6wkmlLQSwUqSKLwmEMhkjp00obhA6wvLpMycOjle6tvIt2kZvjTjpQijGrVd+HEeSY4bYZuHyTfnF0dbA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1631143263503482.9306163685701; Wed, 8 Sep 2021 16:21:03 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.182409.329977 (Exim 4.92) (envelope-from ) id 1mO6s6-0006Km-Kw; Wed, 08 Sep 2021 23:20:50 +0000 Received: by outflank-mailman (output) from mailman id 182409.329977; Wed, 08 Sep 2021 23:20:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mO6s6-0006Ka-Fn; Wed, 08 Sep 2021 23:20:50 +0000 Received: by outflank-mailman (input) for mailman id 182409; Wed, 08 Sep 2021 23:20:49 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mO6s5-00061E-13 for xen-devel@lists.xenproject.org; Wed, 08 Sep 2021 23:20:49 +0000 Received: from us-smtp-delivery-124.mimecast.com (unknown [216.205.24.124]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 667b4552-10fb-11ec-b18c-12813bfff9fa; Wed, 08 Sep 2021 23:20:48 +0000 (UTC) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-501-bkO3WsiWMvqQSzdibUOoCQ-1; Wed, 08 Sep 2021 19:20:47 -0400 Received: by mail-wm1-f71.google.com with SMTP id r126-20020a1c4484000000b002e8858850abso23995wma.0 for ; Wed, 08 Sep 2021 16:20:47 -0700 (PDT) Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id p13sm36976wro.8.2021.09.08.16.20.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 16:20:45 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 667b4552-10fb-11ec-b18c-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631143248; 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=AWN2pZpGs6sHyN/PrFeo6PGJIp1YJY+EJRzHbkMHcxk=; b=eFitySEzpqjh8S+blF/SNzqVLEpUBdOl9Tl+W/tlo6SNOaMsUbPVLtr9QFRC+SKfXNh1ce +4MjvYeIqHgWHSLNxR21Zvm1DaZoMu/qYaFBul8PzCVbFxxXaN3/yTADnb7KInf2kDt3Mk StBfjU7YSg7SugwQnNyiteCvgiUVdHI= X-MC-Unique: bkO3WsiWMvqQSzdibUOoCQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AWN2pZpGs6sHyN/PrFeo6PGJIp1YJY+EJRzHbkMHcxk=; b=xcGqj8lDBFIGP7CUP6lMfOGltp1vO2rKCH09ZyGWJ+B9tebSoXeLcQS1AMTLw1UEJ9 qvp79D88CfGChEF6o/67kvIQ1EQlFkjae8v8Nqln717wm0blO8wmVFzUUrPPrAKPQZ4f yNUeMCgAa4Zv5TY55Pj+s9AHrsAJEa8KQlrOnMLJ/9Ib8TCcS3e3zHys6hHbBzUZhoOe yrP1csqmSd6i5gAWgbU+HkU7ZmfAZqB96w3lyBYKz9+gyU0x++BQXJa1Gz+ebBm1PSY2 5HQb8HkFr9pHK4D8yutCkTYbNzXJwwX9TJ0D7ZzjuPzKpHZdzDySOie51vQ0ULfh4rSl twnw== X-Gm-Message-State: AOAM532LAW26Qy2VTTn1KFe59mltfZQEqRmTkSJ6fesBngeBtVHa5Jhj Gn7oXTIahvWQUiJtFxt/KC1mXxH4WkHPOfhJFI6fE0MMZZd7xAt8E0y2imCSOrW7/bwVoR2SH9r 4/Kone+40YC3hPDQe/mBWw4Wleac= X-Received: by 2002:a05:600c:3641:: with SMTP id y1mr5746027wmq.181.1631143245828; Wed, 08 Sep 2021 16:20:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRx5vddYT6ifvfXuEUZzDhSVwlkW5T8HDOd0oz2QEHRH1Qx3AckLgtuI1lDwOwP+2e9s6Xjw== X-Received: by 2002:a05:600c:3641:: with SMTP id y1mr5746017wmq.181.1631143245705; Wed, 08 Sep 2021 16:20:45 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Prasad J Pandit , "Michael S. Tsirkin" , Markus Armbruster , Paolo Bonzini , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Richard Henderson , qemu-block@nongnu.org, Peter Maydell , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 04/10] block/vvfat: Mark the driver as unsafe Date: Thu, 9 Sep 2021 01:20:18 +0200 Message-Id: <20210908232024.2399215-5-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210908232024.2399215-1-philmd@redhat.com> References: <20210908232024.2399215-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631143265269100004 While being listed as 'supported' in MAINTAINERS, this driver does not have many reviewers and contains various /* TODO */ unattended since various years. Not safe enough for production environment, so have it taint the global security policy. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- block/vvfat.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/block/vvfat.c b/block/vvfat.c index 34bf1e3a86e..993e40727d6 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -3199,6 +3199,11 @@ static void vvfat_close(BlockDriverState *bs) } } =20 +static bool vvfat_taints_security_policy(BlockDriverState *bs) +{ + return true; +} + static const char *const vvfat_strong_runtime_opts[] =3D { "dir", "fat-type", @@ -3219,6 +3224,7 @@ static BlockDriver bdrv_vvfat =3D { .bdrv_refresh_limits =3D vvfat_refresh_limits, .bdrv_close =3D vvfat_close, .bdrv_child_perm =3D vvfat_child_perm, + .bdrv_taints_security_policy =3D vvfat_taints_security_policy, =20 .bdrv_co_preadv =3D vvfat_co_preadv, .bdrv_co_pwritev =3D vvfat_co_pwritev, --=20 2.31.1 From nobody Fri Apr 19 20:02:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@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 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631143256; cv=none; d=zohomail.com; s=zohoarc; b=R+4ffA/KcKW4h1JKbd/yIFxNrF7MQe8JOyj0mFy4qFvpnZ1QO+tL+9YVJ4yRpgoY7Mz/Y/G8K3X7Td4xwqUprPt05kFKOdNuKGH8ysOPfVu5/HqvI6pEjsnSiob2GZl9uf/7Dsvcze1S8FlJoKg6R/EP6eInDI35CotLLIa0gGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631143256; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=p6u3sclI6JBi/0aQ8m/8uYmNWK6u/Efc+CTX33mwcn4=; b=iC5C5ZZsGVyggnMt9bbQY5MHAK+VtlMIdIZMT7TRsOOLgnRp78hfTeAfySxfD4LypgPtpdq7zcKROPAioN85fPlkTfRStInC258WxMsveuQD3LQfVlaIh+JDDnGKmXrJZhbVJvOaBkFkKfB9KUJ9NjAMcSuxTCs51MTTvWKO2mw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 163114325621574.99791664479176; Wed, 8 Sep 2021 16:20:56 -0700 (PDT) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-589-MZZ-qxOFOLWRAjV0NLueKg-1; Wed, 08 Sep 2021 19:20:51 -0400 Received: by mail-wm1-f71.google.com with SMTP id u1-20020a05600c210100b002e74fc5af71so11864wml.1 for ; Wed, 08 Sep 2021 16:20:51 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id c3sm30713wrd.34.2021.09.08.16.20.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 16:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631143255; 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=p6u3sclI6JBi/0aQ8m/8uYmNWK6u/Efc+CTX33mwcn4=; b=UAbntxhNMDLfhVBJUanQ/nbNFX8SsAgORd8PabEo0ooHKj4cGHZLtZJV1Ap4C+4U+v4W1m 9JXqOZLnbflNIhvAsLodB2QDw6saRyC5xk4oXokL4grrM0ug0kgsIlLCH43ermB775L6GW OxaKR8ypL7bHx7uyTyNf2AXNhuX1iS8= X-MC-Unique: MZZ-qxOFOLWRAjV0NLueKg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p6u3sclI6JBi/0aQ8m/8uYmNWK6u/Efc+CTX33mwcn4=; b=JQVj9YY0KENh5y/iQZFT+JxtYtwhp1KvMrWchCY9Mu2kcRoSi6a2GTo9pQEaQJ3nbz dT0QEfXXO58WyK0S9s1FXk0fwYV+Fm4uD6OJJ17SuUIkMvZg/fyn3NlAFQNSzw0tOBMv MrBxFcI3XJFlbCeJv3JNQiUuycRePxH6MhZI5O5rOzyrE+/2VLALWnwlADCdfC9opnTs 4uwl9efo38MeHxhQ+jKuX85QqPyMrLel95RKWWZpQg7jra3EWCDiJUAo6FGisAZbgeZq vHD75Z13jsF/RZ3rjB+c4aVolo4UlhzYdzpmbcO0hrLb9vwBeOI64MupycBiMVZD9ynO /YhA== X-Gm-Message-State: AOAM530GlyOwa215BALf2CA77vLP34NILW+yy5pz1OY5EcN9WPFjYziW +XtT4zdGpLjJTnPpt/be1IUT51D2ihlFzyFQMeaNS5CUfN9vdCz1z4f5vzM7StRWojmxRtUVTbY wefwGQokVRIW7EA== X-Received: by 2002:adf:fb8d:: with SMTP id a13mr108058wrr.164.1631143250629; Wed, 08 Sep 2021 16:20:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrh/n5wSnZqfaTQvrzl6IJ2DKh1pSXkkHEuOdKtVrOvCH+TWDpEiwg1GoyEgBtyhNoco5QeA== X-Received: by 2002:adf:fb8d:: with SMTP id a13mr108055wrr.164.1631143250497; Wed, 08 Sep 2021 16:20:50 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Prasad J Pandit , "Michael S. Tsirkin" , Markus Armbruster , Paolo Bonzini , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Richard Henderson , qemu-block@nongnu.org, Peter Maydell , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 05/10] block/null: Mark 'read-zeroes=off' option as unsafe Date: Thu, 9 Sep 2021 01:20:19 +0200 Message-Id: <20210908232024.2399215-6-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210908232024.2399215-1-philmd@redhat.com> References: <20210908232024.2399215-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631143256687100002 See commit b317006a3f1 ("docs/secure-coding-practices: Describe how to use 'null-co' block driver") for rationale. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- block/null.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/block/null.c b/block/null.c index cc9b1d4ea72..11e428f3cc2 100644 --- a/block/null.c +++ b/block/null.c @@ -99,6 +99,13 @@ static int null_file_open(BlockDriverState *bs, QDict *o= ptions, int flags, return ret; } =20 +static bool null_taints_security_policy(BlockDriverState *bs) +{ + BDRVNullState *s =3D bs->opaque; + + return !s->read_zeroes; +} + static int64_t null_getlength(BlockDriverState *bs) { BDRVNullState *s =3D bs->opaque; @@ -283,6 +290,7 @@ static BlockDriver bdrv_null_co =3D { .bdrv_parse_filename =3D null_co_parse_filename, .bdrv_getlength =3D null_getlength, .bdrv_get_allocated_file_size =3D null_allocated_file_size, + .bdrv_taints_security_policy =3D null_taints_security_policy, =20 .bdrv_co_preadv =3D null_co_preadv, .bdrv_co_pwritev =3D null_co_pwritev, --=20 2.31.1 From nobody Fri Apr 19 20:02:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@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.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631143258; cv=none; d=zohomail.com; s=zohoarc; b=UMQ9lVTUJC8Z4bk+2bJE/x+I/MdJk9giEbkzDAsCKtqJhnCUlZ1TAOX0urCeNgq4nksDZmBnjYOQx7lyR+XWAzaO8ABA3FO9Gs+OsHsDhlQtP8IBmy3rK2/3e7ufdDJfhLR4pJ3ds0hsPTuX/uIbBQL+m5CdDZ3RFc3UTFI07zE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631143258; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=l2rov07jCDHA26r/9GcgxSj1NkWhTs7Eb1vPCWPgxnA=; b=TCM4qTgAgCbrZnZL3AUnB1pXRihU3IFnY9IgVqG+yHGkOwBxoBWIyaTrGvJK7093+3k7tM7/EVC0LALlY/KEqpq+OyvJUJ07uT8D+6caj8viBaRiBIxtB9g7J6boUWiTtL4sYmFLhG75tvFdYfol2Yn6v7lBmYiQpMCTfkbNAIw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1631143258743947.1606397763943; Wed, 8 Sep 2021 16:20:58 -0700 (PDT) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-356-nV7WazX0MTOEUgRf8XMFbg-1; Wed, 08 Sep 2021 19:20:56 -0400 Received: by mail-wm1-f71.google.com with SMTP id v21-20020a05600c215500b002fa7eb53754so32600wml.4 for ; Wed, 08 Sep 2021 16:20:56 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id b22sm390180wmn.18.2021.09.08.16.20.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 16:20:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631143257; 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=l2rov07jCDHA26r/9GcgxSj1NkWhTs7Eb1vPCWPgxnA=; b=RozFAsnnwYFkaB0pfKzK9DQMb1u2uHJ5zI8M5bmUzi/8hI+7Pz8yqiGnYTuGIZcu00cbVd JmeiTD2j6hg3mLMbDNIkcel7sy77u4AYx80QLjruhpnw+Lg4gp+vWK9gnX7w3kR66fr74F 62kzflqAg8uWRDuspmlsA44ZS6bwqdo= X-MC-Unique: nV7WazX0MTOEUgRf8XMFbg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l2rov07jCDHA26r/9GcgxSj1NkWhTs7Eb1vPCWPgxnA=; b=E0UK+j7u3w9HZIHejEZVDVx1ftXWeAB3q9keUWEpdMfACbO9cgi5pP/howzH+bhheJ 1fLA7y3/OCL1MGs4FOBmXI+L98EvLegd3rXA7bo1QoqOcfJuNIO4Mjyg235fRWJ5niz/ pPzthERtmqugLRS2O2dkFFnQRX0/Py2NZLcTlSXn6OGJCvN8PT8DAUKP7KdC09fvPpHr Hv6hGZ01QcLKfgAD8OJf3xx6U/ArO/L9pTvImqMT2eIGDwtI7R6RfMiQfRPtrPBs4qS2 sK4t2087KbcHGLbYxmT6NZoVKysYYC3gyaSmyLQJyflPitOCKcEHOGQVrC8q9U/3vQJq R0ZQ== X-Gm-Message-State: AOAM530BpdrsDd51meh2z38tZwIK9LQHjajLHP2gu/MZ/5qw1Kyhs+ST KL6LoPNyxtaOGPlSpumn1XmFwhE5FSuKxRCnWJqkfxmcbNVJyYU/wHeindh+CPr5LycBCH3/N/V W321/sd8CJbSIiA== X-Received: by 2002:a5d:6781:: with SMTP id v1mr82993wru.249.1631143255221; Wed, 08 Sep 2021 16:20:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0YS7l2ozSVHS0MrlXrrjEkKOBRZTLJQiA3uLjalXryjpOEItjin5eop39X0TrxKIC57agAQ== X-Received: by 2002:a5d:6781:: with SMTP id v1mr82983wru.249.1631143255072; Wed, 08 Sep 2021 16:20:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Prasad J Pandit , "Michael S. Tsirkin" , Markus Armbruster , Paolo Bonzini , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Richard Henderson , qemu-block@nongnu.org, Peter Maydell , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 06/10] qdev: Use qemu_security_policy_taint() API Date: Thu, 9 Sep 2021 01:20:20 +0200 Message-Id: <20210908232024.2399215-7-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210908232024.2399215-1-philmd@redhat.com> References: <20210908232024.2399215-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631143261028100001 Add DeviceClass::taints_security_policy field to allow an unsafe device to eventually taint the global security policy in DeviceRealize(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/qdev-core.h | 6 ++++++ hw/core/qdev.c | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index bafc311bfa1..ff9ce6671be 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -122,6 +122,12 @@ struct DeviceClass { */ bool user_creatable; bool hotpluggable; + /* + * %false if the device is within the QEMU security policy boundary, + * %true if there is no guarantee this device can be used safely. + * See: https://www.qemu.org/contribute/security-process/ + */ + bool taints_security_policy; =20 /* callbacks */ /* diff --git a/hw/core/qdev.c b/hw/core/qdev.c index cefc5eaa0a9..a5a00f3564c 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -31,6 +31,7 @@ #include "qapi/qmp/qerror.h" #include "qapi/visitor.h" #include "qemu/error-report.h" +#include "qemu-common.h" #include "qemu/option.h" #include "hw/hotplug.h" #include "hw/irq.h" @@ -257,6 +258,13 @@ bool qdev_hotplug_allowed(DeviceState *dev, Error **er= rp) MachineClass *mc; Object *m_obj =3D qdev_get_machine(); =20 + if (qemu_security_policy_is_strict() + && DEVICE_GET_CLASS(dev)->taints_security_policy) { + error_setg(errp, "Device '%s' can not be hotplugged when" + " 'strict' security policy is in place", + object_get_typename(OBJECT(dev))); + } + if (object_dynamic_cast(m_obj, TYPE_MACHINE)) { machine =3D MACHINE(m_obj); mc =3D MACHINE_GET_CLASS(machine); @@ -385,6 +393,9 @@ bool qdev_realize(DeviceState *dev, BusState *bus, Erro= r **errp) } else { assert(!DEVICE_GET_CLASS(dev)->bus_type); } + qemu_security_policy_taint(DEVICE_GET_CLASS(dev)->taints_security_poli= cy, + "device type %s", + object_get_typename(OBJECT(dev))); =20 return object_property_set_bool(OBJECT(dev), "realized", true, errp); } --=20 2.31.1 From nobody Fri Apr 19 20:02:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@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 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631143263; cv=none; d=zohomail.com; s=zohoarc; b=agLn5GwiLlspPXRp73TmyO9fVy7JVSRhWstz8es/DxuajAJnzLwPR0XMBPRJ7yiClv12yUXjMlev8S6ZWYSzms/WxCeUXKtXl99sM+m9qcvvOlUIINETvVPBH2pwaIPrViDA6FifuaA3qzM7zzkpYM3I9ykzsYDVp/l8Zml98w0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631143263; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=Qceza/WB3CtMew9GJDkTkDK3S8IfTB0xLv9ykQRmWEY=; b=WSQbyPgTI5uCEc8xAmEVBljWrCPahTYVsuvYZ0RgwAVdLRyU8Njxi9Rc+KBaXa314Hv6uLjqdBElxPkkPcDofv49/nJ1396OycZn9CQw5PP1LKoThvfd9YnNMYTpr/CGrXH3bYLjKDclOIX6MvOtDkNcEOkrYGHl49epoD24zD8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631143263238949.5349385212588; Wed, 8 Sep 2021 16:21:03 -0700 (PDT) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-253-MyzAvPfMMdOMU9BqyhnZ4Q-1; Wed, 08 Sep 2021 19:21:01 -0400 Received: by mail-wm1-f69.google.com with SMTP id b139-20020a1c8091000000b002fb33c467c8so3099wmd.5 for ; Wed, 08 Sep 2021 16:21:01 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id e8sm14000wrc.96.2021.09.08.16.20.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 16:20:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631143262; 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=Qceza/WB3CtMew9GJDkTkDK3S8IfTB0xLv9ykQRmWEY=; b=BZf5flKneby/HH/TUn+2En4hcuRn0nmqUQlhObaQRtHRTS85+MH3RYybtdnDIP/nlNwvYl OqT0y4+C9/70yYBTF9ExiumHax9KbbMvWoqxYzsKno14Lq6ti5oo0k+SYsOzxIrHtDInIZ Ay6kf2TslFss/rF3NzONLuSpIgUsdmU= X-MC-Unique: MyzAvPfMMdOMU9BqyhnZ4Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Qceza/WB3CtMew9GJDkTkDK3S8IfTB0xLv9ykQRmWEY=; b=ilMut2YMBJ01f3WaEJVH04RG3KPpBTHfKSlpY1lo7yRODbISMS5rjLs1uats5yz6E0 VIgprV2d0gfGFDZl7Qb+UgQqHfMCkWrBNPsBlYkymMwb0PAaRI5zma2uK5ydjiYB9YYe /xkOofDv2Zr4KHXWZE+2xjmtDdIjUraQfPLdPqYL2mw3r2NtlpnYWN0PtH4nslje51cP eN0gTcUi0WmsRWIvDcQAtNW2XpqjKpU9R1JgbDrZ0UvNkuQ2OWHLS/cOcE/LPPMYsq1h htwUHH2Ea7OBL84P7ad6M7J3kBXf8Z9dj1MJJAP7LlgXL7idHMScxs/hUyol8tJtjETM m54g== X-Gm-Message-State: AOAM5307Z5OY31Fy7sBdbk4FFTymWFSCbH1n/36D3UTeBuiN2EoLbK6f N2D2Wf8ypuXZSrGrLjR7mfRUj+29bGmJZQWuBzHId8mAlBNO+nYAGpkG90Xdvg/ygSsZZP8+I3N BvQzGw+mw1uJqag== X-Received: by 2002:adf:fd51:: with SMTP id h17mr109109wrs.178.1631143260116; Wed, 08 Sep 2021 16:21:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGCdGOUWAMH7ZAThbx+xTDgHh6zdyfVzIsc9P7NbgQbnC+meNZTqgQ/wi8QkKk51AhWel3JA== X-Received: by 2002:adf:fd51:: with SMTP id h17mr109093wrs.178.1631143259991; Wed, 08 Sep 2021 16:20:59 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Prasad J Pandit , "Michael S. Tsirkin" , Markus Armbruster , Paolo Bonzini , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Richard Henderson , qemu-block@nongnu.org, Peter Maydell , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 07/10] hw/display: Mark ATI and Artist devices as unsafe Date: Thu, 9 Sep 2021 01:20:21 +0200 Message-Id: <20210908232024.2399215-8-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210908232024.2399215-1-philmd@redhat.com> References: <20210908232024.2399215-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631143265258100003 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/artist.c | 1 + hw/display/ati.c | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/display/artist.c b/hw/display/artist.c index 21b7fd1b440..067a4b2cb59 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -1482,6 +1482,7 @@ static void artist_class_init(ObjectClass *klass, voi= d *data) dc->vmsd =3D &vmstate_artist; dc->reset =3D artist_reset; device_class_set_props(dc, artist_properties); + dc->taints_security_policy =3D true; } =20 static const TypeInfo artist_info =3D { diff --git a/hw/display/ati.c b/hw/display/ati.c index 31f22754dce..2f27ab69a87 100644 --- a/hw/display/ati.c +++ b/hw/display/ati.c @@ -1024,6 +1024,7 @@ static void ati_vga_class_init(ObjectClass *klass, vo= id *data) device_class_set_props(dc, ati_vga_properties); dc->hotpluggable =3D false; set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); + dc->taints_security_policy =3D true; =20 k->class_id =3D PCI_CLASS_DISPLAY_VGA; k->vendor_id =3D PCI_VENDOR_ID_ATI; --=20 2.31.1 From nobody Fri Apr 19 20:02:29 2024 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=philmd@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=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631143270; cv=none; d=zohomail.com; s=zohoarc; b=UaHsgtx7lpw0bzBi25B71iVOwimVmcmEXfNQYa9uKuwFOaMrmrvOty9fOnTxXj9SCHRw5g04OUwUQzXqBitGiBa9hWZlJ+kXwhAASZToXKSGyoigSWRk+t8v1NPZprCd4OlcG8xam1+G6uPQMfXm+yAtDX5iStAr0LHEG2ouag4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631143270; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=geCiN4saZ2frlXmhHZT44DYe1b4J1aCN7Xj/FRob9pQ=; b=Xer5lprSCanDA9Vhq8idZlbyoxX6h6fgIoSp3GZ+eTXwQQM7FhjrNS1SFE/9WP/NhryIvm7XDXSo4qXpXH7zRupo5LPjXoYQhEr2Epz6MKvHzvO6B4Bfp4h/kOz2mXYHTO3K+TpO1ZFheC+dx2UgEzUL2uJkFv+TIi18Mjh6aPk= 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=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) 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 1631143270672658.2612369618483; Wed, 8 Sep 2021 16:21:10 -0700 (PDT) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-45-Y5B-ZUtJMgyUvp9vvIAWQg-1; Wed, 08 Sep 2021 19:21:06 -0400 Received: by mail-wm1-f71.google.com with SMTP id c2-20020a7bc8420000b0290238db573ab7so37200wml.5 for ; Wed, 08 Sep 2021 16:21:06 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id t18sm13191wrp.97.2021.09.08.16.21.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 16:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631143269; 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=geCiN4saZ2frlXmhHZT44DYe1b4J1aCN7Xj/FRob9pQ=; b=Ej2G0uBDOnT4bgcRFr2XEZEQUaG9J7w5/mINcOg8a7am3t3rPUNysiTDy+w+eF/s/VuT+p mpc/4x9/mFF+0a9ML2HKhbOG9Joibj5TnStWRA1B3TvQW6aDVAK0DwzSi8orDEbEPssqdn Ognn3BuVOzsI74EyAQEykqlVYpt2uBY= X-MC-Unique: Y5B-ZUtJMgyUvp9vvIAWQg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=geCiN4saZ2frlXmhHZT44DYe1b4J1aCN7Xj/FRob9pQ=; b=mtO+3gsqYklddZ4BEOgJrLGVYdhGH36ydWvrrAGmPe5VklYJ2FLTJhEkfmmVhBbSNS KRCbmw4jicnkxNVM+evAOqwUjoha6jSnY9PZizP6d0y+ETMoL6fcgvdR6TL7DIdAHsZB 9eefzoddYaQzVC8SiueXKBmnyqALwuIvHy5LAXm/+yosPpqZG95eGTB9sHKduFcjzy4r +BkjL7rAXEyQuXzPu2SqYamYKG5fHKd6gWleWwJiaMc6CtUU6hYTv4dIAPPiMn8vksuq rACyzadgMCTIxfd8XEmBSNy90tW0hyEasWPnRsHXap/jpDwmMwLvt/CO2oXhoO0BGSVt 0vOQ== X-Gm-Message-State: AOAM5317+LW/HdZc/80ftD9Tf5ylGIlHwBAi6lXTesJXgwIq5QHSRZQF zNYSF865Oe9RYuPe5/coBoYh2LvKNV8skvC4Ad0WjyGl3Cac8YdSfgDl2uE9I0lk7TYc2PUB8+1 2e0XRMkLfsxrbRw== X-Received: by 2002:a05:600c:3b84:: with SMTP id n4mr5902093wms.50.1631143265001; Wed, 08 Sep 2021 16:21:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCzGiWOShaEshb6oqBDiWr1/WLhbErNDpTZCYYbU0bD2w0oJKgL2kMezD9hKtqCektWiLpSA== X-Received: by 2002:a05:600c:3b84:: with SMTP id n4mr5902087wms.50.1631143264855; Wed, 08 Sep 2021 16:21:04 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Prasad J Pandit , "Michael S. Tsirkin" , Markus Armbruster , Paolo Bonzini , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Richard Henderson , qemu-block@nongnu.org, Peter Maydell , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 08/10] hw/misc: Mark testdev devices as unsafe Date: Thu, 9 Sep 2021 01:20:22 +0200 Message-Id: <20210908232024.2399215-9-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210908232024.2399215-1-philmd@redhat.com> References: <20210908232024.2399215-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631143271774100002 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/hyperv/hyperv_testdev.c | 1 + hw/misc/pc-testdev.c | 1 + hw/misc/pci-testdev.c | 1 + 3 files changed, 3 insertions(+) diff --git a/hw/hyperv/hyperv_testdev.c b/hw/hyperv/hyperv_testdev.c index 9a56ddf83fe..6a75c350389 100644 --- a/hw/hyperv/hyperv_testdev.c +++ b/hw/hyperv/hyperv_testdev.c @@ -310,6 +310,7 @@ static void hv_test_dev_class_init(ObjectClass *klass, = void *data) =20 set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->realize =3D hv_test_dev_realizefn; + dc->taints_security_policy =3D true; } =20 static const TypeInfo hv_test_dev_info =3D { diff --git a/hw/misc/pc-testdev.c b/hw/misc/pc-testdev.c index e3896518694..6294b80ec1b 100644 --- a/hw/misc/pc-testdev.c +++ b/hw/misc/pc-testdev.c @@ -199,6 +199,7 @@ static void testdev_class_init(ObjectClass *klass, void= *data) =20 set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->realize =3D testdev_realizefn; + dc->taints_security_policy =3D true; } =20 static const TypeInfo testdev_info =3D { diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c index 03845c8de34..189eb9bf1bb 100644 --- a/hw/misc/pci-testdev.c +++ b/hw/misc/pci-testdev.c @@ -340,6 +340,7 @@ static void pci_testdev_class_init(ObjectClass *klass, = void *data) set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->reset =3D qdev_pci_testdev_reset; device_class_set_props(dc, pci_testdev_properties); + dc->taints_security_policy =3D true; } =20 static const TypeInfo pci_testdev_info =3D { --=20 2.31.1 From nobody Fri Apr 19 20:02:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@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.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631143273; cv=none; d=zohomail.com; s=zohoarc; b=fii5ljNVgQ4UvMRc4DU87Cmt+BhPwDOte4FKL65xkxq4FdpczHQsz2WvzIkRl6DT3qCrqtmwC8UZ89jdydc/oaKSsLIh/AH0WRpYdCPpCpI2ucNd90K8vbl2dhZmdhXdeTmXEUusBPAXTx8zZfjMp7PTxTnPsfkMgdXLhukzxv0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631143273; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=/j1jkBDfrokHKQKoDNuT1x0UKxyqYOGBFYU13ViaHTo=; b=kFQmGot56Dos4t5b8UX+ZIL3fwMopeCjMrU8BB7qQ0by6N/kEEtjEJROv/Df8Y6+Y9yg+qC+VawZrKxdJeekhC8bLEYHAybP1jRwsM1SPviITGB6QMHeMSgI0hPT+uCJtES28UoIkG0yuEydq4Y9WUi6DKho4rZ1XfvDjwS4VH0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1631143273164470.0905721573797; Wed, 8 Sep 2021 16:21:13 -0700 (PDT) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-560-fmVhHfCeNOSvDANOPr6PXA-1; Wed, 08 Sep 2021 19:21:11 -0400 Received: by mail-wm1-f69.google.com with SMTP id u14-20020a7bcb0e0000b0290248831d46e4so29934wmj.6 for ; Wed, 08 Sep 2021 16:21:10 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id e2sm29478wra.40.2021.09.08.16.21.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 16:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631143272; 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=/j1jkBDfrokHKQKoDNuT1x0UKxyqYOGBFYU13ViaHTo=; b=Fx3nK6aiId+EhkAPAy8QS0GBolzeCzh2xvMPG6f7aQrhShjKYCZdroQd/DNLyUFLK56Djp Gd5/XciW1uABWMQPkhw6rHSd/rocHwVKjN0Fb3yLqWWPDPoYCAXcPdt1598gkRGOk5GDRH vypZj2qYL1L6WRwZ5Y1lMoCBIRlu3IM= X-MC-Unique: fmVhHfCeNOSvDANOPr6PXA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/j1jkBDfrokHKQKoDNuT1x0UKxyqYOGBFYU13ViaHTo=; b=ojh/+koQRE1vO8pRPLbzA8EiKqTAuHPOcHzZjVhXd2Cckf2GKV4Mssb0UU33YYPVbB hP9g9CL9fuMBNwxXOSmGLzJmnlTNQ2wIEkE5zcCj9DgPh3z5PnFNFHVGNG3Gg9HXJX+a 2JY4pWQtD+ClJpx9fB/s3XMSNd4RE2X9RdhPJJyOt8Mo6sMqzI/I9gNZYwyuxPxSqo9i OSnThm3ZgitEchBWsZ6p0VQyIg6QT6cNjGMw99P8m1aBZBluLNp8e6edTqR5MCWp0aZb pp26KuJcAyL6jaOZ2xYK88RXyKzsG/L8O8KxBbIqr+sT/TgQlO/G1tkigvyEETKk4/V/ qU7w== X-Gm-Message-State: AOAM531JF1NxRg8SUbtrqiZQ0t+5rJIXFtlxa5GN2rfDhMs6AzovogYH cR47kquuoBwOE6JOM6SmGdcvH7510pU2mtrcvbv29uOgGEfR6I+Wy7MgU/96DDJRid9kXoKd+iB Y2Ntl1xh7K4unmg== X-Received: by 2002:a1c:f709:: with SMTP id v9mr5800229wmh.124.1631143269932; Wed, 08 Sep 2021 16:21:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsU5M2MRY44dKoBP/lcBIPQuM1MTJ8pmbiG93tEMNWtoFxyRNm7Nzd/6gGAEAcV0FSbIvT1A== X-Received: by 2002:a1c:f709:: with SMTP id v9mr5800221wmh.124.1631143269808; Wed, 08 Sep 2021 16:21:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Prasad J Pandit , "Michael S. Tsirkin" , Markus Armbruster , Paolo Bonzini , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Richard Henderson , qemu-block@nongnu.org, Peter Maydell , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 09/10] hw/net: Mark Tulip device as unsafe Date: Thu, 9 Sep 2021 01:20:23 +0200 Message-Id: <20210908232024.2399215-10-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210908232024.2399215-1-philmd@redhat.com> References: <20210908232024.2399215-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631143273754100005 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/tulip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/tulip.c b/hw/net/tulip.c index ca69f7ea5e1..eaad3266212 100644 --- a/hw/net/tulip.c +++ b/hw/net/tulip.c @@ -1025,6 +1025,7 @@ static void tulip_class_init(ObjectClass *klass, void= *data) device_class_set_props(dc, tulip_properties); dc->reset =3D tulip_qdev_reset; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); + dc->taints_security_policy =3D true; } =20 static const TypeInfo tulip_info =3D { --=20 2.31.1 From nobody Fri Apr 19 20:02:29 2024 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=philmd@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=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631143278; cv=none; d=zohomail.com; s=zohoarc; b=ChQls/GRttVMYdUDyGyE4JsZQR0P/DkFGzstl9MANmDZFu4fMe5xls2fKM/A68X3GQgvazsW7fNR8AVXRPQTIJl97WyLRyaOjoFgtFXisQ6CubGNtx7Zfkk4wFsQaxmdbaI+qAUllPgScb+qpp0OOmY5OOrBe1LhcCJa8h9+pD8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631143278; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=ZkBFAMCpq6n9y+VH8JjTuNHo5ej2dLMGMd9K3LlaeP8=; b=llbJG/st5ms5LRlZ9k4ZISJoBBeDnI+so/aVxVlnLe7fN/EbmMYx9b3ql3aQ2TKGhxk/YeuyVp+kYRrzzYTTgKrKoRjdKDuocIiGzQUW8aH15lpLWpHR5pwkqDKAoG8rwFagSSP8pxCeDSbFxC1f0OxXfe4T6qRxnIveHvhFI+s= 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=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) 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 1631143278589560.4140130122474; Wed, 8 Sep 2021 16:21:18 -0700 (PDT) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-3-at7gztVaOFacFPMpHY5yMA-1; Wed, 08 Sep 2021 19:21:16 -0400 Received: by mail-wm1-f72.google.com with SMTP id c203-20020a1c9ad4000000b002f8cba155ccso38707wme.4 for ; Wed, 08 Sep 2021 16:21:16 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id t64sm344074wma.48.2021.09.08.16.21.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 16:21:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631143277; 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=ZkBFAMCpq6n9y+VH8JjTuNHo5ej2dLMGMd9K3LlaeP8=; b=MbajT/kNKsg4SXBKvHTR6tDLMIIK9gQUeckCC931eQZSpF/3DAT0PItZYHI/N0H3/BXSkH mgVNMFrCiSG+J/8pX7Eo5vNPU5izZBGZXmdUjY39Rzc5qYqdr1iwlNITyuZWSRp48lgDbc BYG9oZIHlsPUzJa+vTOzD1n6xajIZpI= X-MC-Unique: at7gztVaOFacFPMpHY5yMA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZkBFAMCpq6n9y+VH8JjTuNHo5ej2dLMGMd9K3LlaeP8=; b=ig8jpD7etIh8CvSl6O13OtzJ3uJqOSimauTMIRxhyaEi/1DdyUTGwwFbhWYcj9NtEH UnGDoV3qrQpYFyBhKBQFjfgvrvCXFineSJwa993ECGhYaOLDV/6VTQD1jo0ghfVrjpv5 DKplos3d1mBzjnapMLP42BFRzLWJfm4WCyYP/wRvn8k+oG07E9ce7iGlT7tqJvyVd/GC e7hLo6yyykyFdPR5QMYbGr9oM7SLA6XhV1nd24azx3MyF4RbyhPqHq7tc4ONIdJq//Tc CMEaMgMhysytgCkoC+0Zi/vbFWUo4kQ/Je6gZ21xvoJA+/41MzaJkR2Dv7JArSXwWHDY TRjQ== X-Gm-Message-State: AOAM531ixNkdf54ldfz3UFF3mwsUoDLXwWAaY4Qwx5AxR9rEXonxt0tB mIZn8NU5VEVIpZcBftDn/3uxVrWC+nJI1C3F9JHv1/s5ZEv6npPU98CyaDQEKk9/pShp1yKHPWu X387BbD3dlE9k2Q== X-Received: by 2002:a7b:c4cd:: with SMTP id g13mr5796234wmk.91.1631143275277; Wed, 08 Sep 2021 16:21:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybmoGBTuN4rPAmVNoHLJ613PnCRxyUI7oFmyfrpx3hP5AYKM4updonQnfJItVUJwu02OE/7Q== X-Received: by 2002:a7b:c4cd:: with SMTP id g13mr5796223wmk.91.1631143275096; Wed, 08 Sep 2021 16:21:15 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Prasad J Pandit , "Michael S. Tsirkin" , Markus Armbruster , Paolo Bonzini , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Richard Henderson , qemu-block@nongnu.org, Peter Maydell , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 10/10] hw/sd: Mark sdhci-pci device as unsafe Date: Thu, 9 Sep 2021 01:20:24 +0200 Message-Id: <20210908232024.2399215-11-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210908232024.2399215-1-philmd@redhat.com> References: <20210908232024.2399215-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631143280163100002 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/sd/sdhci-pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/sd/sdhci-pci.c b/hw/sd/sdhci-pci.c index c737c8b930e..7a36f88fd87 100644 --- a/hw/sd/sdhci-pci.c +++ b/hw/sd/sdhci-pci.c @@ -64,6 +64,7 @@ static void sdhci_pci_class_init(ObjectClass *klass, void= *data) k->device_id =3D PCI_DEVICE_ID_REDHAT_SDHCI; k->class_id =3D PCI_CLASS_SYSTEM_SDHCI; device_class_set_props(dc, sdhci_pci_properties); + dc->taints_security_policy =3D true; =20 sdhci_common_class_init(klass, data); } --=20 2.31.1