From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.29543.1660746910830385473 for ; Wed, 17 Aug 2022 07:35:11 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: dimitrije.pavlov@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 227C9113E; Wed, 17 Aug 2022 07:35:11 -0700 (PDT) Received: from mammon-apollo-f36.austin.arm.com (mammon-apollo-f36.austin.arm.com [10.118.12.61]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2C3473F70D; Wed, 17 Aug 2022 07:35:10 -0700 (PDT) From: "Dimitrije Pavlov" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Liming Gao , Sunny Wang , Jeff Booher-Kaeding , Samer El-Haj-Mahmoud Subject: [PATCH v1 1/1] OvmfPkg/VirtioNetDxe: Check ChildHandle argument in GetControllerName Date: Wed, 17 Aug 2022 09:35:03 -0500 Message-Id: <20220817143503.3279277-1-dimitrije.pavlov@arm.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Per the UEFI specification, a device driver implementation should return EFI_UNSUPPORTED if the ChildHandle argument in EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName() is not NULL. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Liming Gao Cc: Sunny Wang Cc: Jeff Booher-Kaeding Cc: Samer El-Haj-Mahmoud Signed-off-by: Dimitrije Pavlov --- OvmfPkg/VirtioNetDxe/ComponentName.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OvmfPkg/VirtioNetDxe/ComponentName.c b/OvmfPkg/VirtioNetDxe/= ComponentName.c index e340ca2f8fe4..718096630f6f 100644 --- a/OvmfPkg/VirtioNetDxe/ComponentName.c +++ b/OvmfPkg/VirtioNetDxe/ComponentName.c @@ -129,6 +129,13 @@ VirtioNetGetControllerName ( return EFI_INVALID_PARAMETER; } =20 + // + // This is a device driver, so ChildHandle must be NULL. + // + if (ChildHandle !=3D NULL) { + return EFI_UNSUPPORTED; + } + // // confirm that the device is managed by this driver, using the VirtIo // Protocol --=20 2.37.2