From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.441.1671246629630204207 for ; Fri, 16 Dec 2022 19:10:30 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=GJNx8n8r; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: jiewen.yao@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671246629; x=1702782629; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=+pACefUthvHRg0VYXbqQRzwGmS+0ffRtyF0kQTMGfUU=; b=GJNx8n8rjFN0kbmaG1NLGzRJOV/hMPX0piBPVqq6JzS7PbT9t1xIULIh 9V7fjGT0ZDMH9Yov1sldLp5p4etiGLRnuDwFYP0E14xrFzJu1E8c+BrjP qngS9nhGqGlbtlQ7V8uhdZzOZoXHvxrvMeRXP6xxJoKw5WsVN1+pE/Bqn 74IukxMf2t+5FE/u5Uk4NbJu8cLh8NvKAAcVRqN7FU8zi+yHh9sRyNNCB hMnzTQQJICBV75Y34/UbjHlz8hVGWciPgjWIFGpPCasiU9wcvMr2mlMbd PbBkKd0Ahv8h+FsZybBYFyyx8YNmA9HJvrWFU452THXkvCpefgN1j4ccc w==; X-IronPort-AV: E=McAfee;i="6500,9779,10563"; a="317789132" X-IronPort-AV: E=Sophos;i="5.96,252,1665471600"; d="scan'208";a="317789132" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2022 19:10:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10563"; a="718560331" X-IronPort-AV: E=Sophos;i="5.96,252,1665471600"; d="scan'208";a="718560331" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga004.fm.intel.com with ESMTP; 16 Dec 2022 19:10:29 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 16 Dec 2022 19:10:28 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 16 Dec 2022 19:10:28 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Fri, 16 Dec 2022 19:10:28 -0800 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.43) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Fri, 16 Dec 2022 19:10:28 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ioE/SXomqRLJwo2+Z3F4YC5jI02t4V3dkrQuizmjifdRlTH6QY7qwCe6XovSiY2MzKCR7VQI5R/Vlo4AyD8MsNvONFmsRbY3s7WHLpdQcjWVC39F0UUQZRKTGMlBqRPCwY3XHPOHejeONtxKsDjynsjQuoE755cxO6JuK/+4qQfVKBZ5MOEBNVVEzrowkNqVk4dDWUdd5+FL5pxVbVRb7roZgk4QUQWCG5tlWQTaShXFQYQ2CPFMzdfwTHD2d9WVHMgOGF+EFpo1ut6v8exrLt+kFzW8pgP4rBPcXLEMosq5FfYu/vZmKaIIFPjuoDw8HAGxvh7blkIh8ZjxvpPShA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mm9Ndko10BwN3ndqN5vqJvo2iVe8LABi1NbEFG/3fZA=; b=Qzt80XD+Df+nAaEwqL2eX0uezOLcwFG2FxBw0WWfPthg2sYItGXRUzbIUSQRp9+x8aJfb+yHXfW1eAh4oH88v4dJ7rvYuslnYSXhmlLmr6X1/jN+d3n7ODeSM3D3crm2VcDXbs2e0eWfEMZyx3x3SlxciXQtcenbye0Han5NrO/8Wmck6cmGvPFLokg3kScjkZUffwGoeQZQKEEyb0Z8D/KYCIz8UvabEHzSPb4LnXx8dBOXuVffyIXrbiXDjD1d7/h+KrHkTVHPAsQn2QuPZ5U+T3Hz7UFf7EjUQcl8U8NK3E/Op2i/p5VAiU3RKCb68MwOWLtQkWJdIu0/5/zdpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by BN9PR11MB5243.namprd11.prod.outlook.com (2603:10b6:408:134::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.11; Sat, 17 Dec 2022 03:10:26 +0000 Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::5f56:1bdc:2eae:c041]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::5f56:1bdc:2eae:c041%7]) with mapi id 15.20.5924.012; Sat, 17 Dec 2022 03:10:25 +0000 From: "Yao, Jiewen" To: Gerd Hoffmann , "devel@edk2.groups.io" CC: "Justen, Jordan L" , Ard Biesheuvel , Oliver Steffen , "Pawel Polawski" Subject: Re: [PATCH 1/1] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: add security warning Thread-Topic: [PATCH 1/1] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: add security warning Thread-Index: AQHZETbWM5zr0lwsBkqfXhaXhHkp1K5xYs9Q Date: Sat, 17 Dec 2022 03:10:25 +0000 Message-ID: References: <20221216101134.2201546-1-kraxel@redhat.com> In-Reply-To: <20221216101134.2201546-1-kraxel@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR11MB5872:EE_|BN9PR11MB5243:EE_ x-ms-office365-filtering-correlation-id: 2f97b903-c769-4e6f-6f05-08dadfdc3e68 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1fr8cpn+5jbr1PTx8ZSZomHaO4GnUjNXgBJw08UfJB9Eo2HO8nwAG9PoKqxsf+3hCVuWC6O0YiHG7SgB2oHa0P9ktmu+ji4qWUPFItAZ5AliZ2iZn8SueODPxBe3hzoZXRviZYcNyoD54km50EWMeuqvacxb9CsFUvNGvhl1zfhTV+vNK5BVwpUr844oidKOK/450HZP9HQ9kdwpOFEsVlu347DQRfdAJ3KmJSMcztNBDM7CXPgY0m7Oh4G7HXCYhOlqNr3HifQTgCpMdnh54Wdj4pDr3OMDrfA4hPG8yMovTxmHW43oUGMHOShLF9xLuvQ03UXrXsdFTlJyXzCmXfJLXrDbWzys/3zk3fJImeoabU6tIaITkiRBlNtggkDc9W1Dj0sdmCiJPrak/FvdMbnMILUQ+dTfzfnIZsh01IW1mqDLmtZsG1hXg9LCeXzwLiOaqd3Ug1E6gM1fUnibt298y0Yb8ZaaL+oEOxzqVJhmB+URf3xJf+0GHDlUks/FyY515C8aG+VhtaJkxsNQDRtMp87PKTnkuz59h6Y9g2hYAkFv88Rlw3GwA1XoBMlSH1RWclCp0olurzOKfGknawGYLDfWJhvBHOveA2d60zskdY5nqL/fjYlOYkK7q7FfEJN136HSC5piqR2J50e7JOynGwTgyOr0MNCgFbqt/ooxxaZ8MmXzY66idPVZfAoMAaQ8znQm9Us+n5LhUDXqyGQc9FyzlFqN4/+mZ6ZbmrY7fmuyCYwBV1U+PkgcYmGFz8Fb8DW0ZoD02wpLb/nWqA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR11MB5872.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(396003)(346002)(366004)(376002)(136003)(451199015)(33656002)(41300700001)(5660300002)(52536014)(86362001)(38070700005)(83380400001)(15650500001)(122000001)(38100700002)(82960400001)(8936002)(26005)(316002)(55016003)(2906002)(110136005)(54906003)(966005)(478600001)(6506007)(64756008)(9686003)(4326008)(7696005)(8676002)(66476007)(186003)(53546011)(66946007)(66446008)(71200400001)(66556008)(76116006)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?O5dFsVpnEseG5SGBOmZyRmuO5VmFNFP4qFT821gQfE+usCbqVpBdwfqOK9UU?= =?us-ascii?Q?ftiGJmHIoWfhx5KsC5yPZwWLZ3b7QZrubcIwQuQ9yWcUXahqBrpRN4tzCNhD?= =?us-ascii?Q?Ypy+YTHnIyB7uij/8jLqydlZ3ZGppuc/Hl/CubeF8ZXuBdwNEnToXre6xMtL?= =?us-ascii?Q?v9vAle4orn3KIusgkfXyJkHhyeQI+dJ4vMF7tML0YiiET9vN0wlN8zRJZJ7k?= =?us-ascii?Q?6HEloNXMSn3FDF8Wittte6T2TTA9/0HIM+Fo/NZX5kpSehie7EvZbgU2+r4m?= =?us-ascii?Q?bcztdgWxC6GICSeGCAOIqJlrn706Q+cCIW/upbOJ+GorFkci/yC6IgC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HE/whFoH4n4jxeGnYoQA5ioyJM4yLbpnaGP?= =?us-ascii?Q?OJDN+FeEyCUP8jEqqW7iav2B55xq3+KYteQp0TEpaYtPA8DljIuroEQWcooS?= =?us-ascii?Q?0c9GMudSFN4O8kvWRlSBP1q7fDnKwMHIZgfsv89OerL8njr+j/XDodIKJUNn?= =?us-ascii?Q?TSDnU+OAY7fVY86VGY3dOGdDAVBCh1hRqJAlc2bf0H1xKUfPLEX0xdXcdQ4l?= =?us-ascii?Q?c/FOkL00DeeT3nMG4bZsHLzb/pGKsvJvRJ/7LaDCAmsQRkYEszdSsIW5x1cL?= =?us-ascii?Q?fzgMutXuWPupeaDRJ7heKcvA7cc/NbgEajq7vflYVUuhveEzQhQV2Ptw/vpL?= =?us-ascii?Q?rrT8SRJB/kcDkKPFDeGlTA+HRy0vEslxD/Fc0ITL?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f97b903-c769-4e6f-6f05-08dadfdc3e68 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2022 03:10:25.8552 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: CIKmnqvwVpSVr1jtJ/+8vJxY87+c73TnvQgZjyiLs7wG+STeo3crw8j9FhpPx+WIvGZNng273eFFLYi3gKrFkQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5243 Return-Path: jiewen.yao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Gerd I would like to clarify a couple of things: 1) "Using these builds with writable flash is not secure." Whenever we say "secure" or "not secure", we need align the threat model at= first. What component is trusted? Which is not trusted? Who is adversary? With whi= ch capability? Under which attack scenario?=20 Sometimes, we also say: "UEFI secure boot is not secure", because it cannot= resist the offline hardware attack the flash chip. We only say "UEFI secure boot can resist the system software attack." Also many time, we need debate if DOS attack is in scope or not. If we are going to say something like that, we need a full description. Jus= t saying: "not secure" is not enough. 2) With reason above, I feel that adding comment in the code might not be t= he best idea, because it is too simple to introduce misunderstanding and co= nfusing. Can we add better description in readme? Such as https://github.com/tianoco= re/edk2/blob/master/OvmfPkg/README 3) What is definition of "stateless secure boot configuration" ? What does you mean "stateless"? Do you mean "SMM_REQUIRE=3DFALSE" or someth= ing else? Then why not call it as simple as "secure boot without SMM" ? I don't understand how "SMM_REQUIRE=3DFALSE" will contribute "stateless". I hope we can clarify the terminology if we choose 2). 4) What is the purpose of "Log a warning" ? Is that to tell people, DON'T DO IT? Or is that to tell people, you may play with it by yourself, but don't use = it a production? Or something else? I think we need give a clear answer after we clarify the threat model. Otherwise, a WARNING just adds confusing, IMHO. Thank you Yao Jiewen > -----Original Message----- > From: Gerd Hoffmann > Sent: Friday, December 16, 2022 6:12 PM > To: devel@edk2.groups.io > Cc: Justen, Jordan L ; Gerd Hoffmann > ; Ard Biesheuvel ; Oliver > Steffen ; Pawel Polawski ; > Yao, Jiewen > Subject: [PATCH 1/1] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: add > security warning >=20 > OVMF builds in stateless secure boot configuration > (SECURE_BOOT_ENABLE=3DTRUE + SMM_REQUIRE=3DFALSE) are expected to use > the > emulated variable store (EmuVariableFvbRuntimeDxe) with the store being > re-initialized on each reset (see PlatformInitEmuVariableNvStore()) >=20 > Using these builds with writable flash is not secure. Log a warning > message saying so in case we find such a configuration. >=20 > Signed-off-by: Gerd Hoffmann > --- > OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c > b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c > index 61e1f2e196e5..ab7154685424 100644 > --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c > +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c > @@ -57,6 +57,11 @@ InstallProtocolInterfaces ( > NULL > ); > ASSERT_EFI_ERROR (Status); > + #ifdef SECURE_BOOT_FEATURE_ENABLED > + DEBUG ((DEBUG_WARN, "This build is configured for stateless secure > boot.\n")); > + DEBUG ((DEBUG_WARN, "Using this build with writable flash is NOT > secure.\n")); > + // should we ASSERT(0) here? > + #endif > } else if (IsDevicePathEnd (FvbDevice->DevicePath)) { > // > // Device already exists, so reinstall the FVB protocol > -- > 2.38.1