amboar / culvert

A Test and Debug Tool for BMC AHB Interfaces
Apache License 2.0
48 stars 16 forks source link

Supermicro flashing firmware #36

Closed nanalncux closed 1 year ago

nanalncux commented 1 year ago

I have motherboard Supermicro X11SSL-F. I have compiled an openbmc firmware and am trying to flash this motherboard with it. The discord channel Openbmc advised me to use your tool, but I'm definitely not qualified to figure out what I'm doing wrong. Tell me what can be done about it?

root@hostname ~ # uname -r 6.1.8-arch1-1

Iculvert: v0.4.0-119-g5f4db2b

root@hostname~ # ./culvert --verbose probe [] Found 5 registered bridge drivers [] Trying bridge driver Debug UART [] Unrecognised argument list for debug interface (0) [] Trying bridge driver devmem [] failed to initialise devmem bridge: -1 [] Trying bridge driver iLPC2AHB [] Probing iLPC2AHB [] Probing 0x2e for SuperIO [] Found SuperIO device at 0x2e [] Probing for SoC revision registers [] Found revision 0x2010303 [] Trying bridge driver LPC2AHB [] Failed to initialise L2A bridge: -95 [] Trying bridge driver P2A [] Probing P2A [] Probing for SoC revision registers [] Found revision 0x2010303 [] Probing for SoC revision registers [] Found revision 0x2010303 [] Selected devicetree for SoC 'aspeed,ast2400' [] Found 14 registered drivers [] Bound sdmc driver to /ahb/apb/memory-controller@1e6e0000 [] Bound strap driver to /ahb/apb/syscon@1e6e2000/strapping [] Bound sioctl driver to /ahb/apb/syscon@1e6e2000/superio [] Bound pciectl driver to /ahb/apb/syscon@1e6e2000/bridge-controller [] Bound vuart driver to /ahb/apb/serial@1e787000 [] Bound ilpcctl driver to /ahb/apb/lpc@1e789000/bridge-controller [] Initialised strap driver [] Initialised sioctl driver [] Initialised ilpcctl driver [] Initialised ilpcctl AHB bridge controller [] fdt: Searching devicetree for type 'memory' [] Initialised sdmc driver [] Initialised pciectl driver [] Initialised pciectl AHB bridge controller xdma: Permissive BMC: Disabled VGA: Enabled XDMA on VGA: Enabled XDMA is constrained: No p2a: Permissive BMC: Disabled VGA: Enabled MMIO on VGA: Enabled [0x00000000 - 0x17ffffff] Firmware: Writable [0x18000000 - 0x1fffffff] SoC IO: Writable [0x20000000 - 0x2fffffff] BMC Flash: Writable [0x30000000 - 0x3fffffff] Host Flash: Writable [0x40000000 - 0x5fffffff] DRAM: Writable [0x60000000 - 0x7fffffff] LPC Host: Writable [0x80000000 - 0xffffffff] Reserved: Writable ilpc: Permissive SuperIO address: 0x2e [] Unbound instance of driver ilpcctl [] Unbound instance of driver vuart [] Unbound instance of driver pciectl [] Unbound instance of driver sioctl [] Unbound instance of driver strap [*] Unbound instance of driver sdmc

when i try flashing bmc: ./culvert write firmware < ./path/to/openbmc.mtd I get an error: [*] failed to initialise devmem bridge: -1

When doing the same steps for x11spi, the platform crashes.

amboar commented 1 year ago

Hi @nanalncux,

Did the firmware write succeed? it would be helpful to get the output of ./culvert -vv write firmware < ./path/to/openbmc.mtd, there's not quite enough information to understand what's happened without it.

As for [*] failed to initialise devmem bridge: -1 that's just a log message that got emitted at too high an error level. I should fix that when I have a moment.

When doing the same steps for x11spi, the platform crashes.

Okay, hopefully you saw the big warning in the README :slightly_smiling_face:

DO NOT USE THIS TOOL IF YOU HAVE NOT UNDERSTOOD ITS BEHAVIOURS IN THE CONTEXT OF YOUR TARGET MACHINE.

In that light, culvert really is a best-effort thing. Unfortunately I don't have the time or the resources to implement support for arbitrary platforms that people would like to run it against. It's very likely that you'll need to patch it to make it work for your use case; it's even better if you contribute those patches back!

Fundamentally it is a tool to demonstrate the vulnerabilities outlined in CVE-2019-6260, it just happened to grow into something that was useful for platform bring-up and diagnosing hardware bugs. It serves as a bit of a launching pad for adding bits that are useful to you without having to deal with some of nasty probing and drudgey driver binding stuff required to do something interesting.

Having said that, if you provide some of the information I asked for above I might be able to point you in the right direction.

amboar commented 1 year ago

Closing this one for now as there's no response. If you want to pick up the discussion again, please reopen :)