OK so I've got another theory.
By chance do you have UEFI capsule updates turned off in BIOS setup?
I think that this is a race condition in two BIOS requests happening at inconvenient times and the buffer getting overwritten as a result. In between parsing devices the check for whether capsule updates are turned on may cause that buffer to no longer be valid.
I can't reproduce it on the test suite because the test suite doesn't actually communicate to the BIOS so the buffer wouldn't be overwritten no matter what I did.
I'll share a patch that I believe should fix this.
OK so I've got another theory.
By chance do you have UEFI capsule updates turned off in BIOS setup?
I think that this is a race condition in two BIOS requests happening at inconvenient times and the buffer getting overwritten as a result. In between parsing devices the check for whether capsule updates are turned on may cause that buffer to no longer be valid.
I can't reproduce it on the test suite because the test suite doesn't actually communicate to the BIOS so the buffer wouldn't be overwritten no matter what I did.
I'll share a patch that I believe should fix this.