fwts uefirtvariable test identifies variables with same name but different GUIDs as identical

Bug #1311822 reported by Rod Smith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Firmware Test Suite
Fix Released
High
Ivan Hu

Bug Description

Here's another one:

1) Type "sudo su" to get root shell.
2) Run "fwts uefirtvariable". Get passing results.
2) Type "printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/myvar-12345678-1234-1234-1234-123456789abc".
3) Type "printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/myvar-12345678-1234-1234-1234-123456789abb" (differs from preceding in GUID value but NOT in variable name -- "myvar" in this example).
4) run "fwts uefirtvariable" again.

The result is a spurious failure on test 2:

Test GetNextVariableName interface returns unique variables.
FAILED [HIGH] UEFIRuntimeGetNextVariableName: Test 2, Duplicate variable name
found.

I'm attaching a results.log file that shows two runs, just as in the preceding procedure. Deleting either of the "myvar-*" variable files results in a pass result again. It looks to me like an off-by-one error in bucket_insert(), resulting in a hit on the original variable when looking for a duplicate. Judging by comments in the source code, it looks like a failure in this situation is unintended and is a bug.

FWIW, I first encountered this bug on a Lenovo E530 laptop that had several variables named "AdvancedPage" but different GUIDs, so this bug may crop up in real-world tests.

Revision history for this message
Rod Smith (rodsmith) wrote :
Ivan Hu (ivan.hu)
Changed in fwts:
assignee: nobody → Ivan Hu (ivan.hu)
status: New → In Progress
importance: Undecided → High
Revision history for this message
Ivan Hu (ivan.hu) wrote :
Ivan Hu (ivan.hu)
Changed in fwts:
status: In Progress → Fix Committed
milestone: none → 14.05.00
Ivan Hu (ivan.hu)
Changed in fwts:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.