linux-nvme / nvme-cli

NVMe management command line interface.
https://nvmexpress.org
GNU General Public License v2.0
1.45k stars 650 forks source link

sed: Fix parsing of Discovery0 features #2443

Closed mbroz closed 1 month ago

mbroz commented 1 month ago

TCG SED features have variable sizes, so the code needs to use stored length to move the offset for the next feature. Otherwise, it checks the code at the wrong offset.

igaw commented 1 month ago

@gjoyce-ibm could have a look? Thanks!

igaw commented 1 month ago

I've looked at what the spec says, looks reasonable. Thanks!

gjoyce-ibm commented 1 month ago

The change is correct. I think that the current discovery code got lucky because it was still able to iterate over the key features that it was looking for.