-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Closed
Copy link
Labels
package:securitypkgpriority:mediumModerate impact. Should be prioritized over lower priority issues.Moderate impact. Should be prioritized over lower priority issues.state:needs-maintainer-feedbacktype:bugSomething isn't workingSomething isn't working
Description
Is there an existing issue for this?
- I have searched existing issues
Bug Type
- Firmware
- Tool
- Unit Test
What packages are impacted?
SecurityPkg
Which targets are impacted by this bug?
DEBUG, RELEASE
Current Behavior
In Line 2331, RemoveDevice (), SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
The logic here is incorrect if there are multiple devices in DeviceList.
This way will clear all devices in DeviceList and then cause issue when removing other devices.
if (mOpalDriver.DeviceList == Dev) {
mOpalDriver.DeviceList = NULL;
return;
}
In Line 2336, RemoveDevice (), SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
There is a potential infinite loop if TmpDev->Next not equal to Dev
TmpDev = mOpalDriver.DeviceList;
while (TmpDev->Next != NULL) {
if (TmpDev->Next == Dev) {
TmpDev->Next = Dev->Next;
break;
}
}
Expected Behavior
In Line 2331, RemoveDevice (), SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
It should point to Dev->Next
if (mOpalDriver.DeviceList == Dev) {
mOpalDriver.DeviceList = Dev->Next;
return;
}
In Line 2336, RemoveDevice (), SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
TmpDev should point to next device if TmpDev->Next not equal to Dev
TmpDev = mOpalDriver.DeviceList;
while (TmpDev->Next != NULL) {
if (TmpDev->Next == Dev) {
TmpDev->Next = Dev->Next;
break;
}
TmpDev = TmpDev->Next;
}
Steps To Reproduce
- Add debug msg in OpalEfiDriverBindingStop().
- Connect two nvme Opal devices on systems.
- Boot to EFI Shell.
- Enter
drivers, find OpalPasswordDxe. - Unload OpalPasswordDxe with
unloadcommand. - OpalEfiDriverBindingStop() return EFI_NOT_FOUND for the second devices.
Build Environment
- OS(s): Windows 11
- Tool Chain(s): VS2019Version Information
ALL
Urgency
Medium
Are you going to fix this?
I will fix it
Do you need maintainer feedback?
Maintainer feedback requested
Anything else?
No response
Metadata
Metadata
Assignees
Labels
package:securitypkgpriority:mediumModerate impact. Should be prioritized over lower priority issues.Moderate impact. Should be prioritized over lower priority issues.state:needs-maintainer-feedbacktype:bugSomething isn't workingSomething isn't working