From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@virtuozzo.com header.s=selector2 header.b=mu90b+Jl; spf=pass (domain: virtuozzo.com, ip: 52.101.132.95, mailfrom: rkagan@virtuozzo.com) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (EUR02-HE1-obe.outbound.protection.outlook.com [52.101.132.95]) by groups.io with SMTP; Tue, 13 Aug 2019 04:23:23 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VnAo0B8vC3aM1pYN0cE+FRbd71TvkuqUvBjYaXIg/vFTsxtqZ3RQCcpETT7wD/jCm/tv/dumBDsXDk9vD7jTey5iBHiEbu8kotELOPaPvsQm/xJUQTNHQjXRL+peVaclVHuCXOuewSFM/+YUfAy4eOhuCTTycF8Wk7ZI506xBEdEjrnIQyuUmPru46ZtKQx698B+Gud0+xEZ1Iykgo4wL9IvKbeGxYSDiMnAI5CTWm3qmYg42z2e3LEO4oXDcMTGfojxpcKoYWMPCqxEL+CB52I/5uuopZW6oGA2MiNhs9j/FhOocCTgtNI+GApOwMDpXEL417Zn4ostibOp4A+m7w== 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-SenderADCheck; bh=Ph1wLw/phDdfQQG4pV4PRkpZjvJY5p2DAnnRWAdxDig=; b=HA1LlO5pxd2Ch+rtWO9oVRYjKTNR5QCx8p6VHN0rB+cQDMNiZ8D59Pr+ApCN/vMGSUl7DTeAakQ7qiLikRHM7PKDXmhFfprz9ellquSsPlhK85bIlzpejwnWRs+nrBlceC0SL+M9qQkhHwihElDw1gdyExso3YqitDrt02Ah2wuq7GDpY3Zua2GuZvF2AW9wzgT81yQGXLXTl9CY9az4FqCZrnDuYZOn1TAy/Quw2hqtoc5Hahln5U8HHsO+O5+0HDAaf2+NwC/7JiVZ/0L8GSt1BD4oz20lxFTjQTh+FhwfzAARpY5/6N6/TcUK9gEK1F9kOZLhl5HUQqV9CyT+YA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ph1wLw/phDdfQQG4pV4PRkpZjvJY5p2DAnnRWAdxDig=; b=mu90b+JltHSxFpVIa6CTCF6I/+jCpdX/1m0hG1ocRe/WhUcMcd8Dvnuj5Ngi49uPyZp+E/8L+no5t23096/bgIheQYSuX4azfrqpivREfb7IauaZbVfWqUwCcd9AEFIr7TRFfZilgar2wgBQcbI3LnqVcUrTk4mF3wZYj3lPFRM= Received: from AM6PR08MB3160.eurprd08.prod.outlook.com (52.135.163.161) by AM6PR08MB3991.eurprd08.prod.outlook.com (20.179.1.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.21; Tue, 13 Aug 2019 11:23:12 +0000 Received: from AM6PR08MB3160.eurprd08.prod.outlook.com ([fe80::2c2c:c46e:bdfd:b872]) by AM6PR08MB3160.eurprd08.prod.outlook.com ([fe80::2c2c:c46e:bdfd:b872%6]) with mapi id 15.20.2157.022; Tue, 13 Aug 2019 11:23:12 +0000 From: "Roman Kagan" To: Laszlo Ersek CC: "devel@edk2.groups.io" , Andrew Fish , David Woodhouse Subject: Re: [edk2-devel] static data in dxe_runtime modules Thread-Topic: [edk2-devel] static data in dxe_runtime modules Thread-Index: AQHVSJ2bQrdLTZ7e0UaPDsZ6ZQsRb6borfAAgAOvAoCAA50IAIAAA28AgAGRvwCAAXiMgIAE4pyAgADyWYCAACUSAA== Date: Tue, 13 Aug 2019 11:23:11 +0000 Message-ID: <20190813112308.GB4212@rkaganb.sw.ru> References: <20190801191621.GB14235@rkaganb.sw.ru> <8d18d4f6-5f33-44e9-2758-46350b43c5ec@redhat.com> <20190805101813.GA27171@rkaganb.sw.ru> <406f2250-41e2-9925-b570-38b99a5f6e41@redhat.com> <0A900AFC-C9A0-4A4C-8EBA-9A6F75B3EE25@apple.com> <5d03c05d-24c2-f825-c42e-4371a87d76a1@redhat.com> <15B94CD6CF07DEE2.13696@groups.io> <20190812184303.GA4212@rkaganb.sw.ru> <62712b07-31c1-a19f-1660-12da0d7bac50@redhat.com> In-Reply-To: <62712b07-31c1-a19f-1660-12da0d7bac50@redhat.com> Accept-Language: en-US, ru-RU X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mutt/1.12.1 (2019-06-15) mail-followup-to: Roman Kagan , Laszlo Ersek , devel@edk2.groups.io, Andrew Fish , David Woodhouse x-originating-ip: [185.231.240.5] x-clientproxiedby: HE1PR08CA0050.eurprd08.prod.outlook.com (2603:10a6:7:2a::21) To AM6PR08MB3160.eurprd08.prod.outlook.com (2603:10a6:209:45::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 86e254a6-9fb2-452b-0ecb-08d71fe0a03c x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:AM6PR08MB3991; x-ms-traffictypediagnostic: AM6PR08MB3991:|AM6PR08MB3991: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 01283822F8 x-forefront-antispam-report: SFV:SPM;SFS:(10019020)(346002)(376002)(136003)(366004)(39840400004)(396003)(199004)(189003)(33656002)(9686003)(99286004)(1076003)(58126008)(54906003)(478600001)(256004)(53936002)(5660300002)(71190400001)(316002)(81166006)(8676002)(71200400001)(81156014)(305945005)(6512007)(25786009)(6246003)(6486002)(4326008)(386003)(6506007)(7736002)(6116002)(186003)(26005)(2906002)(64756008)(53546011)(14454004)(66556008)(66476007)(76176011)(36756003)(229853002)(66946007)(102836004)(476003)(446003)(66066001)(86362001)(3846002)(52116002)(486006)(6436002)(11346002)(6916009)(66446008)(8936002)(30126002);DIR:OUT;SFP:1501;SCL:5;SRVR:AM6PR08MB3991;H:AM6PR08MB3160.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) x-ms-exchange-transport-forked: True x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: oth5RHz3EcLAf27ImM+ubS7gYlMltl7zv75wpU2753bsVHUICT4tRRhjlldVg7t5GNIfEu32i0ycH9BUHtXV7TPjVzgBZkPIsyh1q7ZjUvm49gVHspuvoHIkyM8v70pl4YoNwAJZ/oyOa+GKBeliVmuuvmqeF1MeL7DTgJE3SxHkiuC5njJtSXmR/pXcYglTXi0li9XZwdNIPKrf756fJLpfIJ97JoAGWhr9xeD6Kw+7oDdj5BeE+lCIj+BkEtcFIddll2EeN6binPvwj0pTQxJXx/d8THTnlpUxouRUCych5vAG03rTgS/pwdF/QOugb592THazlNX1EZ6Y88dR2HRpr6iiKri8tHKnIPSxv0snE8utwnWRuZOh2xQZcit50FyTS9QbCHMGEw00Mp8ocjfkP8HVeePv3ara39pYtfkdMtKPHdAC4vvM8wiTJIz6y9XI19C5OWcv6H1HBN6HBQL4S9zBuRKqg19AqkknE8ZyZTcnuyhL6+jY0AuuQs+T MIME-Version: 1.0 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86e254a6-9fb2-452b-0ecb-08d71fe0a03c X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Aug 2019 11:23:11.9409 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: O+h+SXC44yKI7mcn/sS+UBmRSSvcWqptw0zCqYTy90MR0Bi5zUb2Q0KQsCKhsZvyUhMioXhIKkFtQqQ8c9OT1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3991 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-ID: On Tue, Aug 13, 2019 at 11:10:27AM +0200, Laszlo Ersek wrote: > On 08/12/19 20:43, Roman Kagan wrote: > > On Fri, Aug 09, 2019 at 04:07:00PM +0000, Roman Kagan via Groups.Io wrote: > >> On Thu, Aug 08, 2019 at 07:39:14PM +0200, Laszlo Ersek wrote: > >>> On 08/07/19 19:41, Andrew Fish wrote: > >>>>> On Aug 7, 2019, at 10:29 AM, Laszlo Ersek wrote: > >>>>> On 08/05/19 12:18, Roman Kagan wrote: > >>>>>> On Sat, Aug 03, 2019 at 04:03:04AM +0200, Laszlo Ersek via Groups.Io wrote: > >>>>>>> On 08/01/19 21:16, Roman Kagan wrote: > >>>>> I'm convinced that OpenSSL needs to expose a new API for this particular > >>>>> problem. > >> > >> Since, as you point out below, the problem only affects the essentially > >> broken configuration (SECURE_BOOT_ENABLE && !SMM_REQUIRE), I'm fine with > >> saving time and effort and sticking to the hack-ish approach proposed in > >> the bugzilla issue, which is to iterate over "thread-local" pointers and > >> EfiConvertPointer() on each. (As long as it fixes the problem of > >> course; I'll test and report back.) > > > > It doesn't :( It just gets slightly further and hits another static > > pointer variable which is not part of the thread-local array: > > > > ... > > Pkcs7Verify > > EVP_add_digest > > OBJ_NAME_add > > > > this one uses a few static pointer variables that are also initialized > > on demand and become stale upon SetVirtualAddressMap(). > > So it looks like the issue can't be solved without making OpenSSL aware > of this use case. Is reloading the module from scratch ruled out completely? I'd try to cook up a patch for that unless there's a strong no-go. Thanks, Roman.