efibootmgr parsing errors with UTF-16 characters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ironic-python-agent |
In Progress
|
Medium
|
Julia Kreger |
Bug Description
A bare metal operator attempted to deploy utilizing IPA on a machine which had an unrelated, accented UTF-8/UTF-16 boundary character (In this case, 0x00FF, an accented lower case y character). This resulted IPA failing to setup the UEFI firmware boot records correctly because it could not parse nor handle the resulting characters.
This was traced down to how oslo.concurrency's processutils execute call, which when normally called, sent stderr and stdout through os.fsdecode.
But os.fsdecode is UTF-8.
It expects everything to be UTF-8.
So the issue here is basically that even then, the character would be parsed as 0xFF, which would generate an error.
Example:
DEBUG ironic_
While investigating this and working up a solution, it was also discovered that we can get other unrelated data from the execution of efibootmgr, because it is returning the raw data from the UEFI NVRAM which is UTF-16 encoded.
The tl;dr being that we need to accept and handle UTF-16 character payloads when running efibootmgr.
In any event, this required making the parser a little more tolerant of errors, while also parsing UTF-16.
This was reported by a Red Hat customer, additional background may be found at: https:/
This issue was fixed in the openstack/ ironic- python- agent 9.5.0 release.