digmorepaka / thinkpad-firmware-patches

Collection of ThinkPad UEFI patches.
Do What The F*ck You Want To Public License
267 stars 24 forks source link

Update patches verified with T540p and USB vendor ID removal #15

Closed FalconFour closed 2 years ago

FalconFour commented 2 years ago

Had a problem using this with my T540p. Diagnosed the issue down to having TWO loops run of the checker, one in PCI-mode and one in USB-mode. The PCI-mode check was patched but the USB-mode check was not patched (possibly missed with the first line I didn't attach a descriptive comment to - that didn't match bytes in my module version).

To do this, I broke the module apart with Ghidra and discovered the unpatched USB check. The original patch did enable advanced BIOS settings page, but it only decreased the number of "unauthorized network adapter" messages from 2 to 1. I traced down that the type of message it was displaying (showing only a VID/PID, and no subsys) was actually faulting for the USB VID, not the PCI VID/subsys. So I simply patched out that check, the same way was the PCI check was patched (jmp, not jz), and voila, it finally let me boot.

(edit to add: not entirely sure, but what's seen as the "VID" is likely the VID+PID combo (4 bytes), not just VID (2 bytes). Don't mind me, just patching together what I know here!)

FalconFour commented 2 years ago

Just saw this in the repo readme, so figure I should include it. I hadn't messed with TPM at all, though I believe (since I have a TPM 1.2 listed in Device Manager) it's always been active - it didn't present any issues. Windows lists the TPM as "Storage: Ready".

Model T540p
TPM Active/working
Notes Added USB-in-m2-slot whitelist bypass (should be relevant to all models)

I guess I should mention that this affected me just because the wireless card I chose was an Intel Wireless-AC 8265 which includes a USB Bluetooth device on-module. Other adapters without Bluetooth likely wouldn't see the issue I had. So this should be a benefit to everyone.